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
8b24c8d6
Commit
8b24c8d6
authored
Dec 22, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 31 spec files: 6 of 10
Mandatory not to break master. Automatically created with prettier.
parent
86ce5406
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
87 additions
and
235 deletions
+87
-235
.prettierignore
.prettierignore
+0
-14
spec/frontend/design_management/components/design_notes/design_discussion_spec.js
...agement/components/design_notes/design_discussion_spec.js
+3
-15
spec/frontend/design_management/pages/index_spec.js
spec/frontend/design_management/pages/index_spec.js
+5
-19
spec/frontend/diffs/components/diff_discussions_spec.js
spec/frontend/diffs/components/diff_discussions_spec.js
+1
-6
spec/frontend/diffs/components/diff_gutter_avatars_spec.js
spec/frontend/diffs/components/diff_gutter_avatars_spec.js
+1
-3
spec/frontend/diffs/components/diff_view_spec.js
spec/frontend/diffs/components/diff_view_spec.js
+1
-6
spec/frontend/diffs/components/image_diff_overlay_spec.js
spec/frontend/diffs/components/image_diff_overlay_spec.js
+2
-12
spec/frontend/diffs/components/tree_list_spec.js
spec/frontend/diffs/components/tree_list_spec.js
+3
-13
spec/frontend/diffs/store/actions_spec.js
spec/frontend/diffs/store/actions_spec.js
+4
-4
spec/frontend/diffs/store/getters_spec.js
spec/frontend/diffs/store/getters_spec.js
+7
-4
spec/frontend/diffs/store/mutations_spec.js
spec/frontend/diffs/store/mutations_spec.js
+1
-1
spec/frontend/error_tracking/components/error_tracking_actions_spec.js
.../error_tracking/components/error_tracking_actions_spec.js
+4
-20
spec/frontend/error_tracking/components/error_tracking_list_spec.js
...end/error_tracking/components/error_tracking_list_spec.js
+3
-12
spec/frontend/error_tracking/store/list/actions_spec.js
spec/frontend/error_tracking/store/list/actions_spec.js
+12
-3
spec/frontend/error_tracking_settings/components/error_tracking_form_spec.js
..._tracking_settings/components/error_tracking_form_spec.js
+4
-12
spec/frontend/feature_flags/components/environments_dropdown_spec.js
...nd/feature_flags/components/environments_dropdown_spec.js
+1
-4
spec/frontend/feature_flags/components/feature_flags_spec.js
spec/frontend/feature_flags/components/feature_flags_spec.js
+3
-5
spec/frontend/feature_flags/components/form_spec.js
spec/frontend/feature_flags/components/form_spec.js
+1
-4
spec/frontend/filtered_search/components/recent_searches_dropdown_content_spec.js
...earch/components/recent_searches_dropdown_content_spec.js
+2
-9
spec/frontend/groups/components/visibility_level_dropdown_spec.js
...ntend/groups/components/visibility_level_dropdown_spec.js
+1
-4
spec/frontend/helpers/monitor_helper_spec.js
spec/frontend/helpers/monitor_helper_spec.js
+5
-1
spec/frontend/helpers/user_mock_data_helper.js
spec/frontend/helpers/user_mock_data_helper.js
+1
-6
spec/frontend/ide/components/file_row_extra_spec.js
spec/frontend/ide/components/file_row_extra_spec.js
+10
-9
spec/frontend/ide/components/file_templates/bar_spec.js
spec/frontend/ide/components/file_templates/bar_spec.js
+1
-4
spec/frontend/ide/components/ide_sidebar_nav_spec.js
spec/frontend/ide/components/ide_sidebar_nav_spec.js
+1
-4
spec/frontend/ide/components/jobs/stage_spec.js
spec/frontend/ide/components/jobs/stage_spec.js
+1
-4
spec/frontend/ide/components/merge_requests/list_spec.js
spec/frontend/ide/components/merge_requests/list_spec.js
+2
-6
spec/frontend/ide/components/pipelines/list_spec.js
spec/frontend/ide/components/pipelines/list_spec.js
+2
-10
spec/frontend/ide/components/repo_commit_section_spec.js
spec/frontend/ide/components/repo_commit_section_spec.js
+2
-12
spec/frontend/ide/lib/create_file_diff_spec.js
spec/frontend/ide/lib/create_file_diff_spec.js
+1
-5
spec/frontend/ide/stores/actions/merge_request_spec.js
spec/frontend/ide/stores/actions/merge_request_spec.js
+1
-1
spec/frontend/ide/stores/modules/commit/actions_spec.js
spec/frontend/ide/stores/modules/commit/actions_spec.js
+1
-3
No files found.
.prettierignore
View file @
8b24c8d6
...
...
@@ -11,20 +11,6 @@ doc/api/graphql/reference/gitlab_schema.graphql
*.md
# temporarly ignored in order to migrate to prettier@2 more efficiently and iteratively:
spec/frontend/design_management/components/design_notes
spec/frontend/design_management/pages
spec/frontend/diffs/components
spec/frontend/diffs/store
spec/frontend/error_tracking/components
spec/frontend/error_tracking/store/list
spec/frontend/error_tracking_settings/components
spec/frontend/feature_flags/components
spec/frontend/filtered_search/components
spec/frontend/groups/components
spec/frontend/helpers
spec/frontend/ide/components
spec/frontend/ide/lib
spec/frontend/ide/stores
spec/frontend/incidents/components
spec/frontend/incidents_settings/components
spec/frontend/integrations/edit/components
...
...
spec/frontend/design_management/components/design_notes/design_discussion_spec.js
View file @
8b24c8d6
...
...
@@ -150,16 +150,8 @@ describe('Design discussions component', () => {
});
it
(
'
shows only the first note
'
,
()
=>
{
expect
(
findDesignNotes
()
.
at
(
0
)
.
isVisible
(),
).
toBe
(
true
);
expect
(
findDesignNotes
()
.
at
(
1
)
.
isVisible
(),
).
toBe
(
false
);
expect
(
findDesignNotes
().
at
(
0
).
isVisible
()).
toBe
(
true
);
expect
(
findDesignNotes
().
at
(
1
).
isVisible
()).
toBe
(
false
);
});
it
(
'
renders resolved message
'
,
()
=>
{
...
...
@@ -193,11 +185,7 @@ describe('Design discussions component', () => {
});
it
(
'
renders the second note
'
,
()
=>
{
expect
(
findDesignNotes
()
.
at
(
1
)
.
isVisible
(),
).
toBe
(
true
);
expect
(
findDesignNotes
().
at
(
1
).
isVisible
()).
toBe
(
true
);
});
it
(
'
renders a reply placeholder
'
,
()
=>
{
...
...
spec/frontend/design_management/pages/index_spec.js
View file @
8b24c8d6
...
...
@@ -545,16 +545,12 @@ describe('Design management index page', () => {
});
it
(
'
adds two designs to selected designs when their checkboxes are checked
'
,
()
=>
{
findDesignCheckboxes
()
.
at
(
0
)
.
trigger
(
'
click
'
);
findDesignCheckboxes
().
at
(
0
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
()
.
then
(()
=>
{
findDesignCheckboxes
()
.
at
(
1
)
.
trigger
(
'
click
'
);
findDesignCheckboxes
().
at
(
1
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
();
})
...
...
@@ -581,9 +577,7 @@ describe('Design management index page', () => {
});
it
(
'
removes all designs from selected designs when at least one design was selected
'
,
()
=>
{
findDesignCheckboxes
()
.
at
(
0
)
.
trigger
(
'
click
'
);
findDesignCheckboxes
().
at
(
0
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
()
...
...
@@ -716,11 +710,7 @@ describe('Design management index page', () => {
await
wrapper
.
vm
.
$nextTick
();
expect
(
findDesigns
()).
toHaveLength
(
3
);
expect
(
findDesigns
()
.
at
(
0
)
.
props
(
'
id
'
),
).
toBe
(
'
1
'
);
expect
(
findDesigns
().
at
(
0
).
props
(
'
id
'
)).
toBe
(
'
1
'
);
});
it
(
'
calls a mutation with correct parameters and reorders designs
'
,
async
()
=>
{
...
...
@@ -732,11 +722,7 @@ describe('Design management index page', () => {
await
wrapper
.
vm
.
$nextTick
();
expect
(
findDesigns
()
.
at
(
0
)
.
props
(
'
id
'
),
).
toBe
(
'
2
'
);
expect
(
findDesigns
().
at
(
0
).
props
(
'
id
'
)).
toBe
(
'
2
'
);
});
it
(
'
prevents reordering when reorderDesigns mutation is in progress
'
,
async
()
=>
{
...
...
spec/frontend/diffs/components/diff_discussions_spec.js
View file @
8b24c8d6
...
...
@@ -91,12 +91,7 @@ describe('DiffDiscussions', () => {
const
noteableDiscussion
=
wrapper
.
find
(
NoteableDiscussion
);
expect
(
noteableDiscussion
.
find
(
'
.badge-pill
'
).
exists
()).
toBe
(
true
);
expect
(
noteableDiscussion
.
find
(
'
.badge-pill
'
)
.
text
()
.
trim
(),
).
toBe
(
'
1
'
);
expect
(
noteableDiscussion
.
find
(
'
.badge-pill
'
).
text
().
trim
()).
toBe
(
'
1
'
);
});
});
});
spec/frontend/diffs/components/diff_gutter_avatars_spec.js
View file @
8b24c8d6
...
...
@@ -66,9 +66,7 @@ describe('DiffGutterAvatars', () => {
});
it
(
'
should emit toggleDiscussions event on avatars click
'
,
()
=>
{
findUserAvatars
()
.
at
(
0
)
.
trigger
(
'
click
'
);
findUserAvatars
().
at
(
0
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
().
toggleLineDiscussions
).
toBeTruthy
();
...
...
spec/frontend/diffs/components/diff_view_spec.js
View file @
8b24c8d6
...
...
@@ -64,12 +64,7 @@ describe('DiffView', () => {
inline
:
type
===
'
inline
'
,
});
expect
(
wrapper
.
findAll
(
DiffCommentCell
).
length
).
toBe
(
total
);
expect
(
wrapper
.
find
(
container
)
.
find
(
DiffCommentCell
)
.
exists
(),
).
toBe
(
true
);
expect
(
wrapper
.
find
(
container
).
find
(
DiffCommentCell
).
exists
()).
toBe
(
true
);
},
);
...
...
spec/frontend/diffs/components/image_diff_overlay_spec.js
View file @
8b24c8d6
...
...
@@ -49,18 +49,8 @@ describe('Diffs image diff overlay component', () => {
createComponent
();
const
imageBadges
=
getAllImageBadges
();
expect
(
imageBadges
.
at
(
0
)
.
text
()
.
trim
(),
).
toBe
(
'
1
'
);
expect
(
imageBadges
.
at
(
1
)
.
text
()
.
trim
(),
).
toBe
(
'
2
'
);
expect
(
imageBadges
.
at
(
0
).
text
().
trim
()).
toBe
(
'
1
'
);
expect
(
imageBadges
.
at
(
1
).
text
().
trim
()).
toBe
(
'
2
'
);
});
it
(
'
renders icon when showCommentIcon is true
'
,
()
=>
{
...
...
spec/frontend/diffs/components/tree_list_spec.js
View file @
8b24c8d6
...
...
@@ -88,16 +88,8 @@ describe('Diffs tree list component', () => {
it
(
'
renders tree
'
,
()
=>
{
expect
(
getFileRows
()).
toHaveLength
(
2
);
expect
(
getFileRows
()
.
at
(
0
)
.
html
(),
).
toContain
(
'
index.js
'
);
expect
(
getFileRows
()
.
at
(
1
)
.
html
(),
).
toContain
(
'
app
'
);
expect
(
getFileRows
().
at
(
0
).
html
()).
toContain
(
'
index.js
'
);
expect
(
getFileRows
().
at
(
1
).
html
()).
toContain
(
'
app
'
);
});
it
(
'
hides file stats
'
,
()
=>
{
...
...
@@ -111,9 +103,7 @@ describe('Diffs tree list component', () => {
it
(
'
calls toggleTreeOpen when clicking folder
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
.
$store
,
'
dispatch
'
).
mockReturnValue
(
undefined
);
getFileRows
()
.
at
(
1
)
.
trigger
(
'
click
'
);
getFileRows
().
at
(
1
).
trigger
(
'
click
'
);
expect
(
wrapper
.
vm
.
$store
.
dispatch
).
toHaveBeenCalledWith
(
'
diffs/toggleTreeOpen
'
,
'
app
'
);
});
...
...
spec/frontend/diffs/store/actions_spec.js
View file @
8b24c8d6
...
...
@@ -272,7 +272,7 @@ describe('DiffsStoreActions', () => {
afterEach
(()
=>
mock
.
restore
());
it
(
'
should commit SET_COVERAGE_DATA with received response
'
,
done
=>
{
const
data
=
{
files
:
{
'
app.js
'
:
{
'
1
'
:
0
,
'
2
'
:
1
}
}
};
const
data
=
{
files
:
{
'
app.js
'
:
{
1
:
0
,
2
:
1
}
}
};
mock
.
onGet
(
endpointCoverage
).
reply
(
200
,
{
data
});
...
...
@@ -1410,7 +1410,7 @@ describe('DiffsStoreActions', () => {
const
state
=
{
diffFiles
:
[{
file_hash
:
'
123
'
}]
};
const
rootGetters
=
{
getDiscussion
:
()
=>
({
diff_file
:
{
file_hash
:
'
123
'
}
}),
notesById
:
{
'
1
'
:
{
discussion_id
:
'
2
'
}
},
notesById
:
{
1
:
{
discussion_id
:
'
2
'
}
},
};
setCurrentDiffFileIdFromNote
({
commit
,
state
,
rootGetters
},
'
1
'
);
...
...
@@ -1423,7 +1423,7 @@ describe('DiffsStoreActions', () => {
const
state
=
{
diffFiles
:
[{
file_hash
:
'
123
'
}]
};
const
rootGetters
=
{
getDiscussion
:
()
=>
({
id
:
'
1
'
}),
notesById
:
{
'
1
'
:
{
discussion_id
:
'
2
'
}
},
notesById
:
{
1
:
{
discussion_id
:
'
2
'
}
},
};
setCurrentDiffFileIdFromNote
({
commit
,
state
,
rootGetters
},
'
1
'
);
...
...
@@ -1436,7 +1436,7 @@ describe('DiffsStoreActions', () => {
const
state
=
{
diffFiles
:
[{
file_hash
:
'
123
'
}]
};
const
rootGetters
=
{
getDiscussion
:
()
=>
({
diff_file
:
{
file_hash
:
'
124
'
}
}),
notesById
:
{
'
1
'
:
{
discussion_id
:
'
2
'
}
},
notesById
:
{
1
:
{
discussion_id
:
'
2
'
}
},
};
setCurrentDiffFileIdFromNote
({
commit
,
state
,
rootGetters
},
'
1
'
);
...
...
spec/frontend/diffs/store/getters_spec.js
View file @
8b24c8d6
...
...
@@ -251,9 +251,12 @@ describe('Diffs Module Getters', () => {
discussionMock
.
diff_file
.
file_hash
=
diffFileMock
.
file_hash
;
expect
(
getters
.
getDiffFileDiscussions
(
localState
,
{},
{},
{
discussions
:
[
discussionMock
]
})(
diffFileMock
,
).
length
,
getters
.
getDiffFileDiscussions
(
localState
,
{},
{},
{
discussions
:
[
discussionMock
]
},
)(
diffFileMock
).
length
,
).
toEqual
(
1
);
});
...
...
@@ -345,7 +348,7 @@ describe('Diffs Module Getters', () => {
describe
(
'
fileLineCoverage
'
,
()
=>
{
beforeEach
(()
=>
{
Object
.
assign
(
localState
.
coverageFiles
,
{
files
:
{
'
app.js
'
:
{
'
1
'
:
0
,
'
2
'
:
5
}
}
});
Object
.
assign
(
localState
.
coverageFiles
,
{
files
:
{
'
app.js
'
:
{
1
:
0
,
2
:
5
}
}
});
});
it
(
'
returns empty object when no coverage data is available
'
,
()
=>
{
...
...
spec/frontend/diffs/store/mutations_spec.js
View file @
8b24c8d6
...
...
@@ -105,7 +105,7 @@ describe('DiffsStoreMutations', () => {
describe
(
'
SET_COVERAGE_DATA
'
,
()
=>
{
it
(
'
should set coverage data properly
'
,
()
=>
{
const
state
=
{
coverageFiles
:
{}
};
const
coverage
=
{
'
app.js
'
:
{
'
1
'
:
0
,
'
2
'
:
1
}
};
const
coverage
=
{
'
app.js
'
:
{
1
:
0
,
2
:
1
}
};
mutations
[
types
.
SET_COVERAGE_DATA
](
state
,
coverage
);
...
...
spec/frontend/error_tracking/components/error_tracking_actions_spec.js
View file @
8b24c8d6
...
...
@@ -41,16 +41,8 @@ describe('Error Tracking Actions', () => {
expect
(
findButtons
().
exists
()).
toBe
(
true
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
findButtons
()
.
at
(
0
)
.
attributes
(
'
title
'
),
).
toBe
(
'
Ignore
'
);
expect
(
findButtons
()
.
at
(
1
)
.
attributes
(
'
title
'
),
).
toBe
(
'
Resolve
'
);
expect
(
findButtons
().
at
(
0
).
attributes
(
'
title
'
)).
toBe
(
'
Ignore
'
);
expect
(
findButtons
().
at
(
1
).
attributes
(
'
title
'
)).
toBe
(
'
Resolve
'
);
});
});
});
...
...
@@ -64,11 +56,7 @@ describe('Error Tracking Actions', () => {
expect
(
findButtons
().
exists
()).
toBe
(
true
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
findButtons
()
.
at
(
0
)
.
attributes
(
'
title
'
),
).
toBe
(
'
Undo Ignore
'
);
expect
(
findButtons
().
at
(
0
).
attributes
(
'
title
'
)).
toBe
(
'
Undo Ignore
'
);
});
});
});
...
...
@@ -82,11 +70,7 @@ describe('Error Tracking Actions', () => {
expect
(
findButtons
().
exists
()).
toBe
(
true
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
findButtons
()
.
at
(
1
)
.
attributes
(
'
title
'
),
).
toBe
(
'
Unresolve
'
);
expect
(
findButtons
().
at
(
1
).
attributes
(
'
title
'
)).
toBe
(
'
Unresolve
'
);
});
});
});
...
...
spec/frontend/error_tracking/components/error_tracking_list_spec.js
View file @
8b24c8d6
...
...
@@ -19,18 +19,9 @@ describe('ErrorTrackingList', () => {
const
findErrorListTable
=
()
=>
wrapper
.
find
(
'
table
'
);
const
findErrorListRows
=
()
=>
wrapper
.
findAll
(
'
tbody tr
'
);
const
dropdownsArray
=
()
=>
wrapper
.
findAll
(
GlDropdown
);
const
findRecentSearchesDropdown
=
()
=>
dropdownsArray
()
.
at
(
0
)
.
find
(
GlDropdown
);
const
findStatusFilterDropdown
=
()
=>
dropdownsArray
()
.
at
(
1
)
.
find
(
GlDropdown
);
const
findSortDropdown
=
()
=>
dropdownsArray
()
.
at
(
2
)
.
find
(
GlDropdown
);
const
findRecentSearchesDropdown
=
()
=>
dropdownsArray
().
at
(
0
).
find
(
GlDropdown
);
const
findStatusFilterDropdown
=
()
=>
dropdownsArray
().
at
(
1
).
find
(
GlDropdown
);
const
findSortDropdown
=
()
=>
dropdownsArray
().
at
(
2
).
find
(
GlDropdown
);
const
findLoadingIcon
=
()
=>
wrapper
.
find
(
GlLoadingIcon
);
const
findPagination
=
()
=>
wrapper
.
find
(
GlPagination
);
const
findErrorActions
=
()
=>
wrapper
.
find
(
ErrorTrackingActions
);
...
...
spec/frontend/error_tracking/store/list/actions_spec.js
View file @
8b24c8d6
...
...
@@ -48,7 +48,10 @@ describe('error tracking actions', () => {
actions
.
startPolling
,
{},
{},
[{
type
:
types
.
SET_LOADING
,
payload
:
true
},
{
type
:
types
.
SET_LOADING
,
payload
:
false
}],
[
{
type
:
types
.
SET_LOADING
,
payload
:
true
},
{
type
:
types
.
SET_LOADING
,
payload
:
false
},
],
[],
()
=>
{
expect
(
createFlash
).
toHaveBeenCalledTimes
(
1
);
...
...
@@ -64,7 +67,10 @@ describe('error tracking actions', () => {
actions
.
restartPolling
,
{},
{},
[{
type
:
types
.
SET_ERRORS
,
payload
:
[]
},
{
type
:
types
.
SET_LOADING
,
payload
:
true
}],
[
{
type
:
types
.
SET_ERRORS
,
payload
:
[]
},
{
type
:
types
.
SET_LOADING
,
payload
:
true
},
],
[],
);
});
...
...
@@ -110,7 +116,10 @@ describe('error tracking actions', () => {
actions
.
sortByField
,
field
,
{},
[{
type
:
types
.
SET_CURSOR
,
payload
:
null
},
{
type
:
types
.
SET_SORT_FIELD
,
payload
:
field
}],
[
{
type
:
types
.
SET_CURSOR
,
payload
:
null
},
{
type
:
types
.
SET_SORT_FIELD
,
payload
:
field
},
],
[{
type
:
'
stopPolling
'
},
{
type
:
'
startPolling
'
}],
);
});
...
...
spec/frontend/error_tracking_settings/components/error_tracking_form_spec.js
View file @
8b24c8d6
...
...
@@ -35,12 +35,7 @@ describe('error tracking settings form', () => {
it
(
'
is rendered
'
,
()
=>
{
expect
(
wrapper
.
findAll
(
GlFormInput
).
length
).
toBe
(
2
);
expect
(
wrapper
.
find
(
GlFormInput
).
attributes
(
'
id
'
)).
toBe
(
'
error-tracking-api-host
'
);
expect
(
wrapper
.
findAll
(
GlFormInput
)
.
at
(
1
)
.
attributes
(
'
id
'
),
).
toBe
(
'
error-tracking-token
'
);
expect
(
wrapper
.
findAll
(
GlFormInput
).
at
(
1
).
attributes
(
'
id
'
)).
toBe
(
'
error-tracking-token
'
);
expect
(
wrapper
.
findAll
(
GlButton
).
exists
()).
toBe
(
true
);
});
...
...
@@ -56,12 +51,9 @@ describe('error tracking settings form', () => {
);
expect
(
pageText
).
not
.
toContain
(
'
Connection has failed. Re-check Auth Token and try again
'
);
expect
(
wrapper
.
findAll
(
GlFormInput
)
.
at
(
0
)
.
attributes
(
'
placeholder
'
),
).
toContain
(
'
https://mysentryserver.com
'
);
expect
(
wrapper
.
findAll
(
GlFormInput
).
at
(
0
).
attributes
(
'
placeholder
'
)).
toContain
(
'
https://mysentryserver.com
'
,
);
});
});
...
...
spec/frontend/feature_flags/components/environments_dropdown_spec.js
View file @
8b24c8d6
...
...
@@ -136,10 +136,7 @@ describe('Feature flags > Environments dropdown ', () => {
});
it
(
'
emits create event
'
,
async
()
=>
{
wrapper
.
findAll
(
GlButton
)
.
at
(
0
)
.
vm
.
$emit
(
'
click
'
);
wrapper
.
findAll
(
GlButton
).
at
(
0
).
vm
.
$emit
(
'
click
'
);
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
emitted
(
'
createClicked
'
)).
toEqual
([[
'
production
'
]]);
});
...
...
spec/frontend/feature_flags/components/feature_flags_spec.js
View file @
8b24c8d6
...
...
@@ -101,11 +101,9 @@ describe('Feature flags', () => {
it
(
'
shows a feature flags limit reached alert
'
,
()
=>
{
expect
(
limitAlert
().
exists
()).
toBe
(
true
);
expect
(
limitAlert
()
.
find
(
GlSprintf
)
.
attributes
(
'
message
'
),
).
toContain
(
'
Feature flags limit reached
'
);
expect
(
limitAlert
().
find
(
GlSprintf
).
attributes
(
'
message
'
)).
toContain
(
'
Feature flags limit reached
'
,
);
});
describe
(
'
when the alert is dismissed
'
,
()
=>
{
...
...
spec/frontend/feature_flags/components/form_spec.js
View file @
8b24c8d6
...
...
@@ -347,10 +347,7 @@ describe('feature flag form', () => {
return
wrapper
.
vm
.
$nextTick
();
})
.
then
(()
=>
{
wrapper
.
find
(
'
.js-add-new-scope
'
)
.
find
(
ToggleButton
)
.
vm
.
$emit
(
'
change
'
,
true
);
wrapper
.
find
(
'
.js-add-new-scope
'
).
find
(
ToggleButton
).
vm
.
$emit
(
'
change
'
,
true
);
})
.
then
(()
=>
{
wrapper
.
find
(
ToggleButton
).
vm
.
$emit
(
'
change
'
,
true
);
...
...
spec/frontend/filtered_search/components/recent_searches_dropdown_content_spec.js
View file @
8b24c8d6
...
...
@@ -84,18 +84,11 @@ describe('Recent Searches Dropdown Content', () => {
});
it
(
'
expect second dropdown to have 2 tokens
'
,
()
=>
{
expect
(
findDropdownItems
()
.
at
(
1
)
.
findAll
(
'
.js-dropdown-token
'
),
).
toHaveLength
(
2
);
expect
(
findDropdownItems
().
at
(
1
).
findAll
(
'
.js-dropdown-token
'
)).
toHaveLength
(
2
);
});
it
(
'
emits recentSearchesItemSelected on dropdown item click
'
,
()
=>
{
findDropdownItems
()
.
at
(
0
)
.
find
(
'
.js-dropdown-button
'
)
.
trigger
(
'
click
'
);
findDropdownItems
().
at
(
0
).
find
(
'
.js-dropdown-button
'
).
trigger
(
'
click
'
);
expect
(
onRecentSearchesItemSelectedSpy
).
toHaveBeenCalledWith
(
'
foo
'
);
});
...
...
spec/frontend/groups/components/visibility_level_dropdown_spec.js
View file @
8b24c8d6
...
...
@@ -56,10 +56,7 @@ describe('Visibility Level Dropdown', () => {
describe
(
'
Selecting an option
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
.
findAll
(
GlDropdownItem
)
.
at
(
1
)
.
vm
.
$emit
(
'
click
'
);
wrapper
.
findAll
(
GlDropdownItem
).
at
(
1
).
vm
.
$emit
(
'
click
'
);
});
it
(
'
sets the value of the hidden input to the selected value
'
,
()
=>
{
...
...
spec/frontend/helpers/monitor_helper_spec.js
View file @
8b24c8d6
...
...
@@ -3,7 +3,11 @@ import { getSeriesLabel, makeDataSeries } from '~/helpers/monitor_helper';
describe
(
'
monitor helper
'
,
()
=>
{
const
defaultConfig
=
{
default
:
true
,
name
:
'
default name
'
};
const
name
=
'
data name
'
;
const
series
=
[[
1
,
1
],
[
2
,
2
],
[
3
,
3
]];
const
series
=
[
[
1
,
1
],
[
2
,
2
],
[
3
,
3
],
];
describe
(
'
getSeriesLabel
'
,
()
=>
{
const
metricAttributes
=
{
__name__
:
'
up
'
,
app
:
'
prometheus
'
};
...
...
spec/frontend/helpers/user_mock_data_helper.js
View file @
8b24c8d6
...
...
@@ -2,12 +2,7 @@ let id = 1;
// Code taken from: https://gist.github.com/6174/6062387
const
getRandomString
=
()
=>
Math
.
random
()
.
toString
(
36
)
.
substring
(
2
,
15
)
+
Math
.
random
()
.
toString
(
36
)
.
substring
(
2
,
15
);
Math
.
random
().
toString
(
36
).
substring
(
2
,
15
)
+
Math
.
random
().
toString
(
36
).
substring
(
2
,
15
);
const
getRandomUrl
=
()
=>
`https://
${
getRandomString
()}
.com/
${
getRandomString
()}
`
;
...
...
spec/frontend/ide/components/file_row_extra_spec.js
View file @
8b24c8d6
...
...
@@ -45,15 +45,16 @@ describe('IDE extra file row component', () => {
expect
(
vm
.
folderChangesTooltip
).
toBe
(
undefined
);
});
[{
input
:
1
,
output
:
'
1 changed file
'
},
{
input
:
2
,
output
:
'
2 changed files
'
}].
forEach
(
({
input
,
output
})
=>
{
it
(
'
returns changed files count if changes count is not 0
'
,
()
=>
{
changesCount
=
input
;
expect
(
vm
.
folderChangesTooltip
).
toBe
(
output
);
});
},
);
[
{
input
:
1
,
output
:
'
1 changed file
'
},
{
input
:
2
,
output
:
'
2 changed files
'
},
].
forEach
(({
input
,
output
})
=>
{
it
(
'
returns changed files count if changes count is not 0
'
,
()
=>
{
changesCount
=
input
;
expect
(
vm
.
folderChangesTooltip
).
toBe
(
output
);
});
});
});
describe
(
'
show tree changes count
'
,
()
=>
{
...
...
spec/frontend/ide/components/file_templates/bar_spec.js
View file @
8b24c8d6
...
...
@@ -67,10 +67,7 @@ describe('IDE file templates bar component', () => {
it
(
'
calls fetchTemplate on click
'
,
()
=>
{
jest
.
spyOn
(
vm
,
'
fetchTemplate
'
).
mockImplementation
();
vm
.
$el
.
querySelectorAll
(
'
.dropdown-content
'
)[
1
]
.
querySelector
(
'
button
'
)
.
click
();
vm
.
$el
.
querySelectorAll
(
'
.dropdown-content
'
)[
1
].
querySelector
(
'
button
'
).
click
();
expect
(
vm
.
fetchTemplate
).
toHaveBeenCalledWith
({
name
:
'
test
'
,
...
...
spec/frontend/ide/components/ide_sidebar_nav_spec.js
View file @
8b24c8d6
...
...
@@ -58,10 +58,7 @@ describe('ide/components/ide_sidebar_nav', () => {
tooltip
:
getBinding
(
button
.
element
,
'
tooltip
'
).
value
,
};
});
const
clickTab
=
()
=>
findButtons
()
.
at
(
TEST_CURRENT_INDEX
)
.
trigger
(
'
click
'
);
const
clickTab
=
()
=>
findButtons
().
at
(
TEST_CURRENT_INDEX
).
trigger
(
'
click
'
);
describe
.
each
`
isOpen | side | otherSide | classes | classesObj | emitEvent | emitArg
...
...
spec/frontend/ide/components/jobs/stage_spec.js
View file @
8b24c8d6
...
...
@@ -60,10 +60,7 @@ describe('IDE pipeline stage', () => {
it
(
'
emits clickViewLog entity with job
'
,
()
=>
{
const
[
job
]
=
defaultProps
.
stage
.
jobs
;
createComponent
();
wrapper
.
findAll
(
Item
)
.
at
(
0
)
.
vm
.
$emit
(
'
clickViewLog
'
,
job
);
wrapper
.
findAll
(
Item
).
at
(
0
).
vm
.
$emit
(
'
clickViewLog
'
,
job
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
emitted
().
clickViewLog
[
0
][
0
]).
toBe
(
job
);
});
...
...
spec/frontend/ide/components/merge_requests/list_spec.js
View file @
8b24c8d6
...
...
@@ -82,9 +82,7 @@ describe('IDE merge requests list', () => {
return
wrapper
.
vm
.
$nextTick
()
.
then
(()
=>
{
findSearchTypeButtons
()
.
at
(
0
)
.
trigger
(
'
click
'
);
findSearchTypeButtons
().
at
(
0
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
();
})
.
then
(()
=>
{
...
...
@@ -168,9 +166,7 @@ describe('IDE merge requests list', () => {
describe
(
'
with search type
'
,
()
=>
{
beforeEach
(()
=>
{
findSearchTypeButtons
()
.
at
(
0
)
.
trigger
(
'
click
'
);
findSearchTypeButtons
().
at
(
0
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
()
...
...
spec/frontend/ide/components/pipelines/list_spec.js
View file @
8b24c8d6
...
...
@@ -165,11 +165,7 @@ describe('IDE pipelines list', () => {
const
isLoadingJobs
=
true
;
createComponent
({},
{
...
withLatestPipelineState
,
stages
,
isLoadingJobs
});
const
jobProps
=
wrapper
.
findAll
(
GlTab
)
.
at
(
0
)
.
find
(
JobsList
)
.
props
();
const
jobProps
=
wrapper
.
findAll
(
GlTab
).
at
(
0
).
find
(
JobsList
).
props
();
expect
(
jobProps
.
stages
).
toBe
(
stages
);
expect
(
jobProps
.
loading
).
toBe
(
isLoadingJobs
);
});
...
...
@@ -180,11 +176,7 @@ describe('IDE pipelines list', () => {
const
isLoadingJobs
=
true
;
createComponent
({},
{
...
withLatestPipelineState
,
isLoadingJobs
});
const
jobProps
=
wrapper
.
findAll
(
GlTab
)
.
at
(
1
)
.
find
(
JobsList
)
.
props
();
const
jobProps
=
wrapper
.
findAll
(
GlTab
).
at
(
1
).
find
(
JobsList
).
props
();
expect
(
jobProps
.
stages
).
toBe
(
failedStages
);
expect
(
jobProps
.
loading
).
toBe
(
isLoadingJobs
);
});
...
...
spec/frontend/ide/components/repo_commit_section_spec.js
View file @
8b24c8d6
...
...
@@ -77,18 +77,8 @@ describe('RepoCommitSection', () => {
});
it
(
'
renders no changes text
'
,
()
=>
{
expect
(
wrapper
.
find
(
EmptyState
)
.
text
()
.
trim
(),
).
toContain
(
'
No changes
'
);
expect
(
wrapper
.
find
(
EmptyState
)
.
find
(
'
img
'
)
.
attributes
(
'
src
'
),
).
toBe
(
TEST_NO_CHANGES_SVG
);
expect
(
wrapper
.
find
(
EmptyState
).
text
().
trim
()).
toContain
(
'
No changes
'
);
expect
(
wrapper
.
find
(
EmptyState
).
find
(
'
img
'
).
attributes
(
'
src
'
)).
toBe
(
TEST_NO_CHANGES_SVG
);
});
});
...
...
spec/frontend/ide/lib/create_file_diff_spec.js
View file @
8b24c8d6
...
...
@@ -21,11 +21,7 @@ const spliceLines = (content, lineNumber, deleteCount = 0, newLines = []) => {
return
lines
.
join
(
'
\n
'
);
};
const
mapLines
=
(
content
,
mapFn
)
=>
content
.
split
(
'
\n
'
)
.
map
(
mapFn
)
.
join
(
'
\n
'
);
const
mapLines
=
(
content
,
mapFn
)
=>
content
.
split
(
'
\n
'
).
map
(
mapFn
).
join
(
'
\n
'
);
describe
(
'
IDE lib/create_file_diff
'
,
()
=>
{
it
(
'
returns empty string with "garbage" action
'
,
()
=>
{
...
...
spec/frontend/ide/stores/actions/merge_request_spec.js
View file @
8b24c8d6
...
...
@@ -71,7 +71,7 @@ describe('IDE store merge request actions', () => {
.
dispatch
(
'
getMergeRequestsForBranch
'
,
{
projectId
:
TEST_PROJECT
,
branchId
:
'
bar
'
})
.
then
(()
=>
{
expect
(
store
.
state
.
projects
.
abcproject
.
mergeRequests
).
toEqual
({
'
2
'
:
expect
.
objectContaining
(
mrData
),
2
:
expect
.
objectContaining
(
mrData
),
});
done
();
})
...
...
spec/frontend/ide/stores/modules/commit/actions_spec.js
View file @
8b24c8d6
...
...
@@ -456,9 +456,7 @@ describe('IDE commit module actions', () => {
.
dispatch
(
'
commit/commitChanges
'
)
.
then
(()
=>
{
expect
(
visitUrl
).
toHaveBeenCalledWith
(
`webUrl/-/merge_requests/new?merge_request[source_branch]=
${
store
.
getters
[
'
commit/placeholderBranchName
'
]
}
&merge_request[target_branch]=master&nav_source=webide`
,
`webUrl/-/merge_requests/new?merge_request[source_branch]=
${
store
.
getters
[
'
commit/placeholderBranchName
'
]}
&merge_request[target_branch]=master&nav_source=webide`
,
);
done
();
...
...
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