Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e37a6d7a
Commit
e37a6d7a
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 32 files - 71 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
dff561fa
Changes
33
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
83 additions
and
117 deletions
+83
-117
.prettierignore
.prettierignore
+0
-34
spec/frontend/vue_shared/components/content_viewer/viewers/markdown_viewer_spec.js
...components/content_viewer/viewers/markdown_viewer_spec.js
+1
-1
spec/frontend/vue_shared/components/date_time_picker/date_time_picker_lib_spec.js
.../components/date_time_picker/date_time_picker_lib_spec.js
+1
-1
spec/frontend/vue_shared/components/date_time_picker/date_time_picker_spec.js
...ared/components/date_time_picker/date_time_picker_spec.js
+2
-2
spec/frontend/vue_shared/components/deprecated_modal_2_spec.js
...frontend/vue_shared/components/deprecated_modal_2_spec.js
+2
-2
spec/frontend/vue_shared/components/diff_viewer/diff_viewer_spec.js
...end/vue_shared/components/diff_viewer/diff_viewer_spec.js
+2
-2
spec/frontend/vue_shared/components/diff_viewer/viewers/image_diff_viewer_spec.js
.../components/diff_viewer/viewers/image_diff_viewer_spec.js
+9
-9
spec/frontend/vue_shared/components/dismissible_container_spec.js
...ntend/vue_shared/components/dismissible_container_spec.js
+1
-1
spec/frontend/vue_shared/components/editor_lite_spec.js
spec/frontend/vue_shared/components/editor_lite_spec.js
+1
-1
spec/frontend/vue_shared/components/expand_button_spec.js
spec/frontend/vue_shared/components/expand_button_spec.js
+4
-4
spec/frontend/vue_shared/components/file_finder/index_spec.js
.../frontend/vue_shared/components/file_finder/index_spec.js
+15
-15
spec/frontend/vue_shared/components/file_finder/item_spec.js
spec/frontend/vue_shared/components/file_finder/item_spec.js
+7
-7
spec/frontend/vue_shared/components/file_tree_spec.js
spec/frontend/vue_shared/components/file_tree_spec.js
+2
-2
spec/frontend/vue_shared/components/filtered_search_bar/filtered_search_bar_root_spec.js
...ents/filtered_search_bar/filtered_search_bar_root_spec.js
+1
-1
spec/frontend/vue_shared/components/filtered_search_bar/store/modules/filters/test_helper.js
.../filtered_search_bar/store/modules/filters/test_helper.js
+2
-2
spec/frontend/vue_shared/components/gl_countdown_spec.js
spec/frontend/vue_shared/components/gl_countdown_spec.js
+3
-3
spec/frontend/vue_shared/components/gl_modal_vuex_spec.js
spec/frontend/vue_shared/components/gl_modal_vuex_spec.js
+3
-3
spec/frontend/vue_shared/components/issuable/issuable_header_warnings_spec.js
...ared/components/issuable/issuable_header_warnings_spec.js
+3
-3
spec/frontend/vue_shared/components/issue/issue_assignees_spec.js
...ntend/vue_shared/components/issue/issue_assignees_spec.js
+3
-3
spec/frontend/vue_shared/components/issue/issue_milestone_spec.js
...ntend/vue_shared/components/issue/issue_milestone_spec.js
+1
-1
spec/frontend/vue_shared/components/local_storage_sync_spec.js
...frontend/vue_shared/components/local_storage_sync_spec.js
+1
-1
spec/frontend/vue_shared/components/markdown/apply_suggestion_spec.js
...d/vue_shared/components/markdown/apply_suggestion_spec.js
+1
-1
spec/frontend/vue_shared/components/markdown/header_spec.js
spec/frontend/vue_shared/components/markdown/header_spec.js
+2
-2
spec/frontend/vue_shared/components/markdown/suggestions_spec.js
...ontend/vue_shared/components/markdown/suggestions_spec.js
+2
-2
spec/frontend/vue_shared/components/markdown/toolbar_button_spec.js
...end/vue_shared/components/markdown/toolbar_button_spec.js
+1
-1
spec/frontend/vue_shared/components/notes/noteable_warning_spec.js
...tend/vue_shared/components/notes/noteable_warning_spec.js
+1
-1
spec/frontend/vue_shared/components/ordered_layout_spec.js
spec/frontend/vue_shared/components/ordered_layout_spec.js
+1
-1
spec/frontend/vue_shared/components/pagination_links_spec.js
spec/frontend/vue_shared/components/pagination_links_spec.js
+1
-1
spec/frontend/vue_shared/components/project_avatar/default_spec.js
...tend/vue_shared/components/project_avatar/default_spec.js
+2
-2
spec/frontend/vue_shared/components/registry/details_row_spec.js
...ontend/vue_shared/components/registry/details_row_spec.js
+1
-1
spec/frontend/vue_shared/components/registry/list_item_spec.js
...frontend/vue_shared/components/registry/list_item_spec.js
+3
-3
spec/frontend/vue_shared/components/registry/metadata_item_spec.js
...tend/vue_shared/components/registry/metadata_item_spec.js
+1
-1
spec/frontend/vue_shared/components/registry/title_area_spec.js
...rontend/vue_shared/components/registry/title_area_spec.js
+3
-3
No files found.
.prettierignore
View file @
e37a6d7a
...
...
@@ -2256,40 +2256,6 @@ spec/frontend/shared/popover_spec.js
spec/frontend/shortcuts_spec.js
spec/frontend/sidebar/assignee_title_spec.js
## trusting-antonelli
spec/frontend/vue_shared/components/content_viewer/viewers/markdown_viewer_spec.js
spec/frontend/vue_shared/components/date_time_picker/date_time_picker_lib_spec.js
spec/frontend/vue_shared/components/date_time_picker/date_time_picker_spec.js
spec/frontend/vue_shared/components/deprecated_modal_2_spec.js
spec/frontend/vue_shared/components/diff_viewer/diff_viewer_spec.js
spec/frontend/vue_shared/components/diff_viewer/viewers/image_diff_viewer_spec.js
spec/frontend/vue_shared/components/dismissible_container_spec.js
spec/frontend/vue_shared/components/editor_lite_spec.js
spec/frontend/vue_shared/components/expand_button_spec.js
spec/frontend/vue_shared/components/file_finder/index_spec.js
spec/frontend/vue_shared/components/file_finder/item_spec.js
spec/frontend/vue_shared/components/file_tree_spec.js
spec/frontend/vue_shared/components/filtered_search_bar/filtered_search_bar_root_spec.js
spec/frontend/vue_shared/components/filtered_search_bar/store/modules/filters/test_helper.js
spec/frontend/vue_shared/components/gl_countdown_spec.js
spec/frontend/vue_shared/components/gl_modal_vuex_spec.js
spec/frontend/vue_shared/components/issuable/issuable_header_warnings_spec.js
spec/frontend/vue_shared/components/issue/issue_assignees_spec.js
spec/frontend/vue_shared/components/issue/issue_milestone_spec.js
spec/frontend/vue_shared/components/local_storage_sync_spec.js
spec/frontend/vue_shared/components/markdown/apply_suggestion_spec.js
spec/frontend/vue_shared/components/markdown/header_spec.js
spec/frontend/vue_shared/components/markdown/suggestions_spec.js
spec/frontend/vue_shared/components/markdown/toolbar_button_spec.js
spec/frontend/vue_shared/components/notes/noteable_warning_spec.js
spec/frontend/vue_shared/components/ordered_layout_spec.js
spec/frontend/vue_shared/components/pagination_links_spec.js
spec/frontend/vue_shared/components/project_avatar/default_spec.js
spec/frontend/vue_shared/components/registry/details_row_spec.js
spec/frontend/vue_shared/components/registry/list_item_spec.js
spec/frontend/vue_shared/components/registry/metadata_item_spec.js
spec/frontend/vue_shared/components/registry/title_area_spec.js
## wizardly-agnesi
spec/frontend/vue_shared/components/rich_content_editor/editor_service_spec.js
spec/frontend/vue_shared/components/rich_content_editor/modals/add_image/upload_image_tab_spec.js
...
...
spec/frontend/vue_shared/components/content_viewer/viewers/markdown_viewer_spec.js
View file @
e37a6d7a
...
...
@@ -9,7 +9,7 @@ describe('MarkdownViewer', () => {
let
wrapper
;
let
mock
;
const
createComponent
=
props
=>
{
const
createComponent
=
(
props
)
=>
{
wrapper
=
mount
(
MarkdownViewer
,
{
propsData
:
{
...
props
,
...
...
spec/frontend/vue_shared/components/date_time_picker/date_time_picker_lib_spec.js
View file @
e37a6d7a
...
...
@@ -71,7 +71,7 @@ describe('date time picker lib', () => {
'
2019-19-23
'
,
'
2019-09-23 x
'
,
'
2019-09-29 24:24:24
'
,
].
forEach
(
input
=>
{
].
forEach
(
(
input
)
=>
{
it
(
`throws error for invalid input like
${
input
}
`
,
()
=>
{
expect
(()
=>
inputStringToIsoDate
(
input
)).
toThrow
();
});
...
...
spec/frontend/vue_shared/components/date_time_picker/date_time_picker_spec.js
View file @
e37a6d7a
...
...
@@ -17,7 +17,7 @@ describe('DateTimePicker', () => {
const
applyButtonElement
=
()
=>
wrapper
.
find
(
'
button.btn-success
'
).
element
;
const
findQuickRangeItems
=
()
=>
wrapper
.
findAll
(
'
.dropdown-item
'
);
const
createComponent
=
props
=>
{
const
createComponent
=
(
props
)
=>
{
wrapper
=
mount
(
DateTimePicker
,
{
propsData
:
{
...
props
,
...
...
@@ -235,7 +235,7 @@ describe('DateTimePicker', () => {
it
(
'
unchecks quick range when text is input is clicked
'
,
()
=>
{
const
findActiveItems
=
()
=>
findQuickRangeItems
().
filter
(
w
=>
w
.
classes
().
includes
(
'
active
'
));
findQuickRangeItems
().
filter
(
(
w
)
=>
w
.
classes
().
includes
(
'
active
'
));
expect
(
findActiveItems
().
length
).
toBe
(
1
);
...
...
spec/frontend/vue_shared/components/deprecated_modal_2_spec.js
View file @
e37a6d7a
...
...
@@ -156,12 +156,12 @@ describe('DeprecatedModal2', () => {
describe
(
'
slots
'
,
()
=>
{
const
slotContent
=
'
this should go into the slot
'
;
const
modalWithSlot
=
slot
=>
{
const
modalWithSlot
=
(
slot
)
=>
{
return
Vue
.
extend
({
components
:
{
DeprecatedModal2
,
},
render
:
h
=>
render
:
(
h
)
=>
h
(
'
deprecated-modal-2
'
,
[
slot
?
h
(
'
template
'
,
{
slot
},
slotContent
)
:
slotContent
]),
});
};
...
...
spec/frontend/vue_shared/components/diff_viewer/diff_viewer_spec.js
View file @
e37a6d7a
...
...
@@ -26,7 +26,7 @@ describe('DiffViewer', () => {
vm
.
$destroy
();
});
it
(
'
renders image diff
'
,
done
=>
{
it
(
'
renders image diff
'
,
(
done
)
=>
{
window
.
gon
=
{
relative_url_root
:
''
,
};
...
...
@@ -46,7 +46,7 @@ describe('DiffViewer', () => {
});
});
it
(
'
renders fallback download diff display
'
,
done
=>
{
it
(
'
renders fallback download diff display
'
,
(
done
)
=>
{
createComponent
({
...
requiredProps
,
diffViewerMode
:
'
added
'
,
...
...
spec/frontend/vue_shared/components/diff_viewer/viewers/image_diff_viewer_spec.js
View file @
e37a6d7a
...
...
@@ -51,7 +51,7 @@ describe('ImageDiffViewer', () => {
wrapper
.
destroy
();
});
it
(
'
renders image diff for replaced
'
,
done
=>
{
it
(
'
renders image diff for replaced
'
,
(
done
)
=>
{
createComponent
({
...
allProps
});
vm
.
$nextTick
(()
=>
{
...
...
@@ -78,7 +78,7 @@ describe('ImageDiffViewer', () => {
});
});
it
(
'
renders image diff for new
'
,
done
=>
{
it
(
'
renders image diff for new
'
,
(
done
)
=>
{
createComponent
({
...
allProps
,
diffMode
:
'
new
'
,
oldPath
:
''
});
setImmediate
(()
=>
{
...
...
@@ -91,7 +91,7 @@ describe('ImageDiffViewer', () => {
});
});
it
(
'
renders image diff for deleted
'
,
done
=>
{
it
(
'
renders image diff for deleted
'
,
(
done
)
=>
{
createComponent
({
...
allProps
,
diffMode
:
'
deleted
'
,
newPath
:
''
});
setImmediate
(()
=>
{
...
...
@@ -104,7 +104,7 @@ describe('ImageDiffViewer', () => {
});
});
it
(
'
renders image diff for renamed
'
,
done
=>
{
it
(
'
renders image diff for renamed
'
,
(
done
)
=>
{
vm
=
new
Vue
({
components
:
{
imageDiffViewer
,
...
...
@@ -139,7 +139,7 @@ describe('ImageDiffViewer', () => {
});
describe
(
'
swipeMode
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
createComponent
({
...
requiredProps
});
setImmediate
(()
=>
{
...
...
@@ -147,7 +147,7 @@ describe('ImageDiffViewer', () => {
});
});
it
(
'
switches to Swipe Mode
'
,
done
=>
{
it
(
'
switches to Swipe Mode
'
,
(
done
)
=>
{
vm
.
$el
.
querySelector
(
'
.view-modes-menu li:nth-child(2)
'
).
click
();
vm
.
$nextTick
(()
=>
{
...
...
@@ -158,7 +158,7 @@ describe('ImageDiffViewer', () => {
});
describe
(
'
onionSkin
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
createComponent
({
...
requiredProps
});
setImmediate
(()
=>
{
...
...
@@ -166,7 +166,7 @@ describe('ImageDiffViewer', () => {
});
});
it
(
'
switches to Onion Skin Mode
'
,
done
=>
{
it
(
'
switches to Onion Skin Mode
'
,
(
done
)
=>
{
vm
.
$el
.
querySelector
(
'
.view-modes-menu li:nth-child(3)
'
).
click
();
vm
.
$nextTick
(()
=>
{
...
...
@@ -177,7 +177,7 @@ describe('ImageDiffViewer', () => {
});
});
it
(
'
has working drag handler
'
,
done
=>
{
it
(
'
has working drag handler
'
,
(
done
)
=>
{
vm
.
$el
.
querySelector
(
'
.view-modes-menu li:nth-child(3)
'
).
click
();
vm
.
$nextTick
(()
=>
{
...
...
spec/frontend/vue_shared/components/dismissible_container_spec.js
View file @
e37a6d7a
...
...
@@ -43,7 +43,7 @@ describe('DismissibleContainer', () => {
default
:
'
default slot
'
,
};
it
.
each
(
Object
.
keys
(
slots
))(
'
renders the %s slot
'
,
slot
=>
{
it
.
each
(
Object
.
keys
(
slots
))(
'
renders the %s slot
'
,
(
slot
)
=>
{
const
slotContent
=
slots
[
slot
];
wrapper
=
shallowMount
(
dismissibleContainer
,
{
propsData
,
...
...
spec/frontend/vue_shared/components/editor_lite_spec.js
View file @
e37a6d7a
...
...
@@ -47,7 +47,7 @@ describe('Editor Lite component', () => {
wrapper
.
destroy
();
});
const
triggerChangeContent
=
val
=>
{
const
triggerChangeContent
=
(
val
)
=>
{
mockInstance
.
getValue
.
mockReturnValue
(
val
);
const
[
cb
]
=
mockInstance
.
onDidChangeModelContent
.
mock
.
calls
[
0
];
...
...
spec/frontend/vue_shared/components/expand_button_spec.js
View file @
e37a6d7a
...
...
@@ -66,7 +66,7 @@ describe('Expand button', () => {
});
describe
(
'
on click
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
expanderPrependEl
().
trigger
(
'
click
'
);
Vue
.
nextTick
(
done
);
});
...
...
@@ -85,7 +85,7 @@ describe('Expand button', () => {
});
describe
(
'
when short text is provided
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
factory
({
slots
:
{
expanded
:
`<p>
${
text
.
expanded
}
</p>`
,
...
...
@@ -110,7 +110,7 @@ describe('Expand button', () => {
});
describe
(
'
append button
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
expanderPrependEl
().
trigger
(
'
click
'
);
Vue
.
nextTick
(
done
);
});
...
...
@@ -134,7 +134,7 @@ describe('Expand button', () => {
});
describe
(
'
when short text is provided
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
factory
({
slots
:
{
expanded
:
`<p>
${
text
.
expanded
}
</p>`
,
...
...
spec/frontend/vue_shared/components/file_finder/index_spec.js
View file @
e37a6d7a
...
...
@@ -31,7 +31,7 @@ describe('File finder item spec', () => {
});
describe
(
'
with entries
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
createComponent
({
files
:
[
{
...
...
@@ -57,7 +57,7 @@ describe('File finder item spec', () => {
expect
(
vm
.
$el
.
textContent
).
not
.
toContain
(
'
folder
'
);
});
it
(
'
filters entries
'
,
done
=>
{
it
(
'
filters entries
'
,
(
done
)
=>
{
vm
.
searchText
=
'
index
'
;
setImmediate
(()
=>
{
...
...
@@ -68,7 +68,7 @@ describe('File finder item spec', () => {
});
});
it
(
'
shows clear button when searchText is not empty
'
,
done
=>
{
it
(
'
shows clear button when searchText is not empty
'
,
(
done
)
=>
{
vm
.
searchText
=
'
index
'
;
setImmediate
(()
=>
{
...
...
@@ -79,7 +79,7 @@ describe('File finder item spec', () => {
});
});
it
(
'
clear button resets searchText
'
,
done
=>
{
it
(
'
clear button resets searchText
'
,
(
done
)
=>
{
vm
.
searchText
=
'
index
'
;
waitForPromises
()
...
...
@@ -94,7 +94,7 @@ describe('File finder item spec', () => {
.
catch
(
done
.
fail
);
});
it
(
'
clear button focuses search input
'
,
done
=>
{
it
(
'
clear button focuses search input
'
,
(
done
)
=>
{
jest
.
spyOn
(
vm
.
$refs
.
searchInput
,
'
focus
'
).
mockImplementation
(()
=>
{});
vm
.
searchText
=
'
index
'
;
...
...
@@ -111,7 +111,7 @@ describe('File finder item spec', () => {
});
describe
(
'
listShowCount
'
,
()
=>
{
it
(
'
returns 1 when no filtered entries exist
'
,
done
=>
{
it
(
'
returns 1 when no filtered entries exist
'
,
(
done
)
=>
{
vm
.
searchText
=
'
testing 123
'
;
setImmediate
(()
=>
{
...
...
@@ -131,7 +131,7 @@ describe('File finder item spec', () => {
expect
(
vm
.
listHeight
).
toBe
(
55
);
});
it
(
'
returns 33 when entries dont exist
'
,
done
=>
{
it
(
'
returns 33 when entries dont exist
'
,
(
done
)
=>
{
vm
.
searchText
=
'
testing 123
'
;
setImmediate
(()
=>
{
...
...
@@ -143,7 +143,7 @@ describe('File finder item spec', () => {
});
describe
(
'
filteredBlobsLength
'
,
()
=>
{
it
(
'
returns length of filtered blobs
'
,
done
=>
{
it
(
'
returns length of filtered blobs
'
,
(
done
)
=>
{
vm
.
searchText
=
'
index
'
;
setImmediate
(()
=>
{
...
...
@@ -156,7 +156,7 @@ describe('File finder item spec', () => {
describe
(
'
watches
'
,
()
=>
{
describe
(
'
searchText
'
,
()
=>
{
it
(
'
resets focusedIndex when updated
'
,
done
=>
{
it
(
'
resets focusedIndex when updated
'
,
(
done
)
=>
{
vm
.
focusedIndex
=
1
;
vm
.
searchText
=
'
test
'
;
...
...
@@ -169,7 +169,7 @@ describe('File finder item spec', () => {
});
describe
(
'
visible
'
,
()
=>
{
it
(
'
returns searchText when false
'
,
done
=>
{
it
(
'
returns searchText when false
'
,
(
done
)
=>
{
vm
.
searchText
=
'
test
'
;
vm
.
visible
=
true
;
...
...
@@ -206,7 +206,7 @@ describe('File finder item spec', () => {
});
describe
(
'
onKeyup
'
,
()
=>
{
it
(
'
opens file on enter key
'
,
done
=>
{
it
(
'
opens file on enter key
'
,
(
done
)
=>
{
const
event
=
new
CustomEvent
(
'
keyup
'
);
event
.
keyCode
=
ENTER_KEY_CODE
;
...
...
@@ -221,7 +221,7 @@ describe('File finder item spec', () => {
});
});
it
(
'
closes file finder on esc key
'
,
done
=>
{
it
(
'
closes file finder on esc key
'
,
(
done
)
=>
{
const
event
=
new
CustomEvent
(
'
keyup
'
);
event
.
keyCode
=
ESC_KEY_CODE
;
...
...
@@ -300,7 +300,7 @@ describe('File finder item spec', () => {
});
describe
(
'
keyboard shortcuts
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
createComponent
();
jest
.
spyOn
(
vm
,
'
toggle
'
).
mockImplementation
(()
=>
{});
...
...
@@ -308,7 +308,7 @@ describe('File finder item spec', () => {
vm
.
$nextTick
(
done
);
});
it
(
'
calls toggle on `t` key press
'
,
done
=>
{
it
(
'
calls toggle on `t` key press
'
,
(
done
)
=>
{
Mousetrap
.
trigger
(
'
t
'
);
vm
.
$nextTick
()
...
...
@@ -319,7 +319,7 @@ describe('File finder item spec', () => {
.
catch
(
done
.
fail
);
});
it
(
'
calls toggle on `mod+p` key press
'
,
done
=>
{
it
(
'
calls toggle on `mod+p` key press
'
,
(
done
)
=>
{
Mousetrap
.
trigger
(
'
mod+p
'
);
vm
.
$nextTick
()
...
...
spec/frontend/vue_shared/components/file_finder/item_spec.js
View file @
e37a6d7a
...
...
@@ -37,7 +37,7 @@ describe('File finder item spec', () => {
expect
(
vm
.
$el
.
classList
).
toContain
(
'
is-focused
'
);
});
it
(
'
does not have is-focused class when not focused
'
,
done
=>
{
it
(
'
does not have is-focused class when not focused
'
,
(
done
)
=>
{
vm
.
focused
=
false
;
vm
.
$nextTick
(()
=>
{
...
...
@@ -53,7 +53,7 @@ describe('File finder item spec', () => {
expect
(
vm
.
$el
.
querySelector
(
'
.diff-changed-stats
'
)).
toBe
(
null
);
});
it
(
'
renders when a changed file
'
,
done
=>
{
it
(
'
renders when a changed file
'
,
(
done
)
=>
{
vm
.
file
.
changed
=
true
;
vm
.
$nextTick
(()
=>
{
...
...
@@ -63,7 +63,7 @@ describe('File finder item spec', () => {
});
});
it
(
'
renders when a temp file
'
,
done
=>
{
it
(
'
renders when a temp file
'
,
(
done
)
=>
{
vm
.
file
.
tempFile
=
true
;
vm
.
$nextTick
(()
=>
{
...
...
@@ -85,7 +85,7 @@ describe('File finder item spec', () => {
describe
(
'
path
'
,
()
=>
{
let
el
;
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
vm
.
searchText
=
'
file
'
;
el
=
vm
.
$el
.
querySelector
(
'
.diff-changed-file-path
'
);
...
...
@@ -97,7 +97,7 @@ describe('File finder item spec', () => {
expect
(
el
.
querySelectorAll
(
'
.highlighted
'
).
length
).
toBe
(
4
);
});
it
(
'
adds ellipsis to long text
'
,
done
=>
{
it
(
'
adds ellipsis to long text
'
,
(
done
)
=>
{
vm
.
file
.
path
=
new
Array
(
70
)
.
fill
()
.
map
((
_
,
i
)
=>
`
${
i
}
-`
)
...
...
@@ -113,7 +113,7 @@ describe('File finder item spec', () => {
describe
(
'
name
'
,
()
=>
{
let
el
;
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
vm
.
searchText
=
'
file
'
;
el
=
vm
.
$el
.
querySelector
(
'
.diff-changed-file-name
'
);
...
...
@@ -125,7 +125,7 @@ describe('File finder item spec', () => {
expect
(
el
.
querySelectorAll
(
'
.highlighted
'
).
length
).
toBe
(
4
);
});
it
(
'
does not add ellipsis to long text
'
,
done
=>
{
it
(
'
does not add ellipsis to long text
'
,
(
done
)
=>
{
vm
.
file
.
name
=
new
Array
(
70
)
.
fill
()
.
map
((
_
,
i
)
=>
`
${
i
}
-`
)
...
...
spec/frontend/vue_shared/components/file_tree_spec.js
View file @
e37a6d7a
...
...
@@ -28,7 +28,7 @@ describe('File Tree component', () => {
const
findFileRow
=
()
=>
wrapper
.
find
(
MockFileRow
);
const
findChildrenTrees
=
()
=>
wrapper
.
findAll
(
FileTree
).
wrappers
.
slice
(
1
);
const
findChildrenTreeProps
=
()
=>
findChildrenTrees
().
map
(
x
=>
({
findChildrenTrees
().
map
(
(
x
)
=>
({
...
x
.
props
(),
...
pick
(
x
.
attributes
(),
Object
.
keys
(
TEST_EXTA_ARGS
)),
}));
...
...
@@ -61,7 +61,7 @@ describe('File Tree component', () => {
describe
(
'
file tree
'
,
()
=>
{
const
createChildren
=
()
=>
[{
id
:
1
},
{
id
:
2
}];
const
createChildrenExpectation
=
(
props
=
{})
=>
createChildren
().
map
(
file
=>
({
createChildren
().
map
(
(
file
)
=>
({
fileRowComponent
:
MockFileRow
,
file
,
...
TEST_EXTA_ARGS
,
...
...
spec/frontend/vue_shared/components/filtered_search_bar/filtered_search_bar_root_spec.js
View file @
e37a6d7a
...
...
@@ -28,7 +28,7 @@ import {
}
from
'
./mock_data
'
;
jest
.
mock
(
'
~/vue_shared/components/filtered_search_bar/filtered_search_utils
'
,
()
=>
({
uniqueTokens
:
jest
.
fn
().
mockImplementation
(
tokens
=>
tokens
),
uniqueTokens
:
jest
.
fn
().
mockImplementation
(
(
tokens
)
=>
tokens
),
stripQuotes
:
jest
.
requireActual
(
'
~/vue_shared/components/filtered_search_bar/filtered_search_utils
'
,
).
stripQuotes
,
...
...
spec/frontend/vue_shared/components/filtered_search_bar/store/modules/filters/test_helper.js
View file @
e37a6d7a
export
function
getFilterParams
(
tokens
,
options
=
{})
{
const
{
key
=
'
value
'
,
operator
=
'
=
'
,
prop
=
'
title
'
}
=
options
;
return
tokens
.
map
(
token
=>
{
return
tokens
.
map
(
(
token
)
=>
{
return
{
[
key
]:
token
[
prop
],
operator
};
});
}
export
function
getFilterValues
(
tokens
,
options
=
{})
{
const
{
prop
=
'
title
'
}
=
options
;
return
tokens
.
map
(
token
=>
token
[
prop
]);
return
tokens
.
map
(
(
token
)
=>
token
[
prop
]);
}
spec/frontend/vue_shared/components/gl_countdown_spec.js
View file @
e37a6d7a
...
...
@@ -17,7 +17,7 @@ describe('GlCountdown', () => {
});
describe
(
'
when there is time remaining
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
vm
=
mountComponent
(
Component
,
{
endDateString
:
'
2000-01-01T01:02:03Z
'
,
});
...
...
@@ -29,7 +29,7 @@ describe('GlCountdown', () => {
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
01:02:03
'
);
});
it
(
'
updates remaining time
'
,
done
=>
{
it
(
'
updates remaining time
'
,
(
done
)
=>
{
now
=
'
2000-01-01T00:00:01Z
'
;
jest
.
advanceTimersByTime
(
1000
);
...
...
@@ -43,7 +43,7 @@ describe('GlCountdown', () => {
});
describe
(
'
when there is no time remaining
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
vm
=
mountComponent
(
Component
,
{
endDateString
:
'
1900-01-01T00:00:00Z
'
,
});
...
...
spec/frontend/vue_shared/components/gl_modal_vuex_spec.js
View file @
e37a6d7a
...
...
@@ -118,7 +118,7 @@ describe('GlModalVuex', () => {
expect
(
actions
.
hide
).
toHaveBeenCalledTimes
(
1
);
});
it
(
'
calls bootstrap show when isVisible changes
'
,
done
=>
{
it
(
'
calls bootstrap show when isVisible changes
'
,
(
done
)
=>
{
state
.
isVisible
=
false
;
factory
();
...
...
@@ -135,7 +135,7 @@ describe('GlModalVuex', () => {
.
catch
(
done
.
fail
);
});
it
(
'
calls bootstrap hide when isVisible changes
'
,
done
=>
{
it
(
'
calls bootstrap hide when isVisible changes
'
,
(
done
)
=>
{
state
.
isVisible
=
true
;
factory
();
...
...
@@ -154,7 +154,7 @@ describe('GlModalVuex', () => {
it
.
each
([
'
ok
'
,
'
cancel
'
])(
'
passes an "%s" handler to the "modal-footer" slot scope
'
,
handlerName
=>
{
(
handlerName
)
=>
{
state
.
isVisible
=
true
;
const
modalFooterSlotContent
=
jest
.
fn
();
...
...
spec/frontend/vue_shared/components/issuable/issuable_header_warnings_spec.js
View file @
e37a6d7a
...
...
@@ -17,13 +17,13 @@ describe('IssuableHeaderWarnings', () => {
const
findConfidentialIcon
=
()
=>
wrapper
.
find
(
'
[data-testid="confidential"]
'
);
const
findLockedIcon
=
()
=>
wrapper
.
find
(
'
[data-testid="locked"]
'
);
const
renderTestMessage
=
renders
=>
(
renders
?
'
renders
'
:
'
does not render
'
);
const
renderTestMessage
=
(
renders
)
=>
(
renders
?
'
renders
'
:
'
does not render
'
);
const
setLock
=
locked
=>
{
const
setLock
=
(
locked
)
=>
{
store
.
getters
.
getNoteableData
.
discussion_locked
=
locked
;
};
const
setConfidential
=
confidential
=>
{
const
setConfidential
=
(
confidential
)
=>
{
store
.
getters
.
getNoteableData
.
confidential
=
confidential
;
};
...
...
spec/frontend/vue_shared/components/issue/issue_assignees_spec.js
View file @
e37a6d7a
...
...
@@ -11,7 +11,7 @@ describe('IssueAssigneesComponent', () => {
let
wrapper
;
let
vm
;
const
factory
=
props
=>
{
const
factory
=
(
props
)
=>
{
wrapper
=
shallowMount
(
IssueAssignees
,
{
propsData
:
{
assignees
:
mockAssigneesList
,
...
...
@@ -99,11 +99,11 @@ describe('IssueAssigneesComponent', () => {
});
it
(
'
renders assignee
'
,
()
=>
{
const
data
=
findAvatars
().
wrappers
.
map
(
x
=>
({
const
data
=
findAvatars
().
wrappers
.
map
(
(
x
)
=>
({
...
x
.
props
(),
}));
const
expected
=
mockAssigneesList
.
slice
(
0
,
TEST_MAX_VISIBLE
-
1
).
map
(
x
=>
const
expected
=
mockAssigneesList
.
slice
(
0
,
TEST_MAX_VISIBLE
-
1
).
map
(
(
x
)
=>
expect
.
objectContaining
({
linkHref
:
x
.
web_url
,
imgAlt
:
`Avatar for
${
x
.
name
}
`
,
...
...
spec/frontend/vue_shared/components/issue/issue_milestone_spec.js
View file @
e37a6d7a
...
...
@@ -19,7 +19,7 @@ describe('IssueMilestoneComponent', () => {
let
wrapper
;
let
vm
;
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
wrapper
=
createComponent
();
({
vm
}
=
wrapper
);
...
...
spec/frontend/vue_shared/components/local_storage_sync_spec.js
View file @
e37a6d7a
...
...
@@ -49,7 +49,7 @@ describe('Local Storage Sync', () => {
it
.
each
(
'
foo
'
,
3
,
true
,
[
'
foo
'
,
'
bar
'
],
{
foo
:
'
bar
'
})(
'
saves updated value to localStorage
'
,
newValue
=>
{
(
newValue
)
=>
{
createComponent
({
props
:
{
storageKey
,
...
...
spec/frontend/vue_shared/components/markdown/apply_suggestion_spec.js
View file @
e37a6d7a
...
...
@@ -6,7 +6,7 @@ describe('Apply Suggestion component', () => {
const
propsData
=
{
fileName
:
'
test.js
'
,
disabled
:
false
};
let
wrapper
;
const
createWrapper
=
props
=>
{
const
createWrapper
=
(
props
)
=>
{
wrapper
=
shallowMount
(
ApplySuggestionComponent
,
{
propsData
:
{
...
propsData
,
...
props
}
});
};
...
...
spec/frontend/vue_shared/components/markdown/header_spec.js
View file @
e37a6d7a
...
...
@@ -6,7 +6,7 @@ import ToolbarButton from '~/vue_shared/components/markdown/toolbar_button.vue';
describe
(
'
Markdown field header component
'
,
()
=>
{
let
wrapper
;
const
createWrapper
=
props
=>
{
const
createWrapper
=
(
props
)
=>
{
wrapper
=
shallowMount
(
HeaderComponent
,
{
propsData
:
{
previewMarkdown
:
false
,
...
...
@@ -18,7 +18,7 @@ describe('Markdown field header component', () => {
const
findToolbarButtons
=
()
=>
wrapper
.
findAll
(
ToolbarButton
);
const
findToolbarButtonByProp
=
(
prop
,
value
)
=>
findToolbarButtons
()
.
filter
(
button
=>
button
.
props
(
prop
)
===
value
)
.
filter
(
(
button
)
=>
button
.
props
(
prop
)
===
value
)
.
at
(
0
);
beforeEach
(()
=>
{
...
...
spec/frontend/vue_shared/components/markdown/suggestions_spec.js
View file @
e37a6d7a
...
...
@@ -50,7 +50,7 @@ describe('Suggestion component', () => {
let
vm
;
let
diffTable
;
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
const
Component
=
Vue
.
extend
(
SuggestionsComponent
);
vm
=
new
Component
({
...
...
@@ -86,7 +86,7 @@ describe('Suggestion component', () => {
});
it
(
'
generates a diff table that contains contents the suggested lines
'
,
()
=>
{
MOCK_DATA
.
suggestions
[
0
].
diff_lines
.
forEach
(
line
=>
{
MOCK_DATA
.
suggestions
[
0
].
diff_lines
.
forEach
(
(
line
)
=>
{
const
text
=
line
.
text
.
substring
(
1
);
expect
(
diffTable
.
innerHTML
.
includes
(
text
)).
toBe
(
true
);
...
...
spec/frontend/vue_shared/components/markdown/toolbar_button_spec.js
View file @
e37a6d7a
...
...
@@ -10,7 +10,7 @@ describe('toolbar_button', () => {
tag
:
'
test tag
'
,
};
const
createComponent
=
propUpdates
=>
{
const
createComponent
=
(
propUpdates
)
=>
{
wrapper
=
shallowMount
(
ToolbarButton
,
{
propsData
:
{
...
defaultProps
,
...
...
spec/frontend/vue_shared/components/notes/noteable_warning_spec.js
View file @
e37a6d7a
...
...
@@ -10,7 +10,7 @@ describe('Issue Warning Component', () => {
const
findConfidentialBlock
=
(
w
=
wrapper
)
=>
w
.
find
({
ref
:
'
confidential
'
});
const
findLockedAndConfidentialBlock
=
(
w
=
wrapper
)
=>
w
.
find
({
ref
:
'
lockedAndConfidential
'
});
const
createComponent
=
props
=>
const
createComponent
=
(
props
)
=>
shallowMount
(
NoteableWarning
,
{
propsData
:
{
...
props
,
...
...
spec/frontend/vue_shared/components/ordered_layout_spec.js
View file @
e37a6d7a
...
...
@@ -29,7 +29,7 @@ describe('Ordered Layout', () => {
const
verifyOrder
=
()
=>
wrapper
.
findAll
(
'
footer,header
'
)
.
wrappers
.
map
(
x
=>
(
x
.
element
.
tagName
===
'
FOOTER
'
?
'
footer
'
:
'
header
'
));
.
wrappers
.
map
(
(
x
)
=>
(
x
.
element
.
tagName
===
'
FOOTER
'
?
'
footer
'
:
'
header
'
));
const
createComponent
=
(
props
=
{})
=>
{
wrapper
=
mount
(
TestComponent
,
{
...
...
spec/frontend/vue_shared/components/pagination_links_spec.js
View file @
e37a6d7a
...
...
@@ -49,7 +49,7 @@ describe('Pagination links component', () => {
});
it
(
'
should provide translated text to GitLab UI pagination
'
,
()
=>
{
Object
.
entries
(
translations
).
forEach
(
entry
=>
{
Object
.
entries
(
translations
).
forEach
(
(
entry
)
=>
{
expect
(
glPagination
.
vm
[
entry
[
0
]]).
toBe
(
entry
[
1
]);
});
});
...
...
spec/frontend/vue_shared/components/project_avatar/default_spec.js
View file @
e37a6d7a
...
...
@@ -19,7 +19,7 @@ describe('ProjectAvatarDefault component', () => {
vm
.
$destroy
();
});
it
(
'
renders identicon if project has no avatar_url
'
,
done
=>
{
it
(
'
renders identicon if project has no avatar_url
'
,
(
done
)
=>
{
const
expectedText
=
getFirstCharacterCapitalized
(
projectData
.
name
);
vm
.
project
=
{
...
...
@@ -38,7 +38,7 @@ describe('ProjectAvatarDefault component', () => {
.
catch
(
done
.
fail
);
});
it
(
'
renders avatar image if project has avatar_url
'
,
done
=>
{
it
(
'
renders avatar image if project has avatar_url
'
,
(
done
)
=>
{
const
avatarUrl
=
`
${
TEST_HOST
}
/images/home/nasa.svg`
;
vm
.
project
=
{
...
...
spec/frontend/vue_shared/components/registry/details_row_spec.js
View file @
e37a6d7a
...
...
@@ -8,7 +8,7 @@ describe('DetailsRow', () => {
const
findIcon
=
()
=>
wrapper
.
find
(
GlIcon
);
const
findDefaultSlot
=
()
=>
wrapper
.
find
(
'
[data-testid="default-slot"]
'
);
const
mountComponent
=
props
=>
{
const
mountComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
component
,
{
propsData
:
{
icon
:
'
clock
'
,
...
...
spec/frontend/vue_shared/components/registry/list_item_spec.js
View file @
e37a6d7a
...
...
@@ -11,7 +11,7 @@ describe('list item', () => {
const
findRightPrimarySlot
=
()
=>
wrapper
.
find
(
'
[data-testid="right-primary"]
'
);
const
findRightSecondarySlot
=
()
=>
wrapper
.
find
(
'
[data-testid="right-secondary"]
'
);
const
findRightActionSlot
=
()
=>
wrapper
.
find
(
'
[data-testid="right-action"]
'
);
const
findDetailsSlot
=
name
=>
wrapper
.
find
(
`[data-testid="
${
name
}
"]`
);
const
findDetailsSlot
=
(
name
)
=>
wrapper
.
find
(
`[data-testid="
${
name
}
"]`
);
const
findToggleDetailsButton
=
()
=>
wrapper
.
find
(
GlButton
);
const
mountComponent
=
(
propsData
,
slots
)
=>
{
...
...
@@ -74,14 +74,14 @@ describe('list item', () => {
findToggleDetailsButton
().
vm
.
$emit
(
'
click
'
);
await
wrapper
.
vm
.
$nextTick
();
slotNames
.
forEach
(
name
=>
{
slotNames
.
forEach
(
(
name
)
=>
{
expect
(
findDetailsSlot
(
name
).
exists
()).
toBe
(
true
);
});
});
it
(
'
are not visible when details are not shown
'
,
()
=>
{
mountComponent
({},
slotMocks
);
slotNames
.
forEach
(
name
=>
{
slotNames
.
forEach
(
(
name
)
=>
{
expect
(
findDetailsSlot
(
name
).
exists
()).
toBe
(
false
);
});
});
...
...
spec/frontend/vue_shared/components/registry/metadata_item_spec.js
View file @
e37a6d7a
...
...
@@ -25,7 +25,7 @@ describe('Metadata Item', () => {
const
findText
=
()
=>
wrapper
.
find
(
'
[data-testid="metadata-item-text"]
'
);
const
findTooltipOnTruncate
=
(
w
=
wrapper
)
=>
w
.
find
(
TooltipOnTruncate
);
describe
.
each
([
'
xs
'
,
'
s
'
,
'
m
'
,
'
l
'
,
'
xl
'
])(
'
size class
'
,
size
=>
{
describe
.
each
([
'
xs
'
,
'
s
'
,
'
m
'
,
'
l
'
,
'
xl
'
])(
'
size class
'
,
(
size
)
=>
{
const
className
=
`mw-
${
size
}
`
;
it
(
`
${
size
}
is assigned correctly to text`
,
()
=>
{
...
...
spec/frontend/vue_shared/components/registry/title_area_spec.js
View file @
e37a6d7a
...
...
@@ -9,7 +9,7 @@ describe('title area', () => {
const
findSubHeaderSlot
=
()
=>
wrapper
.
find
(
'
[data-testid="sub-header"]
'
);
const
findRightActionsSlot
=
()
=>
wrapper
.
find
(
'
[data-testid="right-actions"]
'
);
const
findMetadataSlot
=
name
=>
wrapper
.
find
(
`[data-testid="
${
name
}
"]`
);
const
findMetadataSlot
=
(
name
)
=>
wrapper
.
find
(
`[data-testid="
${
name
}
"]`
);
const
findTitle
=
()
=>
wrapper
.
find
(
'
[data-testid="title"]
'
);
const
findAvatar
=
()
=>
wrapper
.
find
(
GlAvatar
);
const
findInfoMessages
=
()
=>
wrapper
.
findAll
(
'
[data-testid="info-message"]
'
);
...
...
@@ -97,7 +97,7 @@ describe('title area', () => {
mountComponent
({
slots
:
slotMocks
});
await
wrapper
.
vm
.
$nextTick
();
slotNames
.
forEach
(
name
=>
{
slotNames
.
forEach
(
(
name
)
=>
{
expect
(
findMetadataSlot
(
name
).
exists
()).
toBe
(
true
);
});
});
...
...
@@ -106,7 +106,7 @@ describe('title area', () => {
mountComponent
({
slots
:
slotMocks
,
propsData
:
{
title
:
'
foo
'
,
metadataLoading
:
true
}
});
await
wrapper
.
vm
.
$nextTick
();
slotNames
.
forEach
(
name
=>
{
slotNames
.
forEach
(
(
name
)
=>
{
expect
(
findMetadataSlot
(
name
).
exists
()).
toBe
(
false
);
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment