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
c35cc92c
Commit
c35cc92c
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 33 files - 61 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
280a79c0
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
126 additions
and
161 deletions
+126
-161
.prettierignore
.prettierignore
+0
-35
spec/frontend/ide/stores/modules/branches/actions_spec.js
spec/frontend/ide/stores/modules/branches/actions_spec.js
+6
-6
spec/frontend/ide/stores/modules/branches/mutations_spec.js
spec/frontend/ide/stores/modules/branches/mutations_spec.js
+1
-1
spec/frontend/ide/stores/modules/clientside/actions_spec.js
spec/frontend/ide/stores/modules/clientside/actions_spec.js
+1
-1
spec/frontend/ide/stores/modules/commit/actions_spec.js
spec/frontend/ide/stores/modules/commit/actions_spec.js
+25
-25
spec/frontend/ide/stores/modules/commit/getters_spec.js
spec/frontend/ide/stores/modules/commit/getters_spec.js
+1
-1
spec/frontend/ide/stores/modules/file_templates/actions_spec.js
...rontend/ide/stores/modules/file_templates/actions_spec.js
+11
-11
spec/frontend/ide/stores/modules/merge_requests/actions_spec.js
...rontend/ide/stores/modules/merge_requests/actions_spec.js
+7
-7
spec/frontend/ide/stores/modules/pane/actions_spec.js
spec/frontend/ide/stores/modules/pane/actions_spec.js
+6
-6
spec/frontend/ide/stores/modules/pipelines/actions_spec.js
spec/frontend/ide/stores/modules/pipelines/actions_spec.js
+23
-23
spec/frontend/ide/stores/modules/pipelines/mutations_spec.js
spec/frontend/ide/stores/modules/pipelines/mutations_spec.js
+1
-1
spec/frontend/ide/stores/modules/terminal/actions/checks_spec.js
...ontend/ide/stores/modules/terminal/actions/checks_spec.js
+1
-1
spec/frontend/ide/stores/modules/terminal/actions/session_controls_spec.js
.../stores/modules/terminal/actions/session_controls_spec.js
+1
-1
spec/frontend/ide/stores/modules/terminal/actions/session_status_spec.js
...de/stores/modules/terminal/actions/session_status_spec.js
+1
-1
spec/frontend/ide/stores/modules/terminal_sync/actions_spec.js
...frontend/ide/stores/modules/terminal_sync/actions_spec.js
+4
-4
spec/frontend/ide/stores/mutations/file_spec.js
spec/frontend/ide/stores/mutations/file_spec.js
+2
-2
spec/frontend/ide/sync_router_and_store_spec.js
spec/frontend/ide/sync_router_and_store_spec.js
+2
-2
spec/frontend/ide/utils_spec.js
spec/frontend/ide/utils_spec.js
+1
-1
spec/frontend/image_diff/init_discussion_tab_spec.js
spec/frontend/image_diff/init_discussion_tab_spec.js
+2
-2
spec/frontend/image_diff/replaced_image_diff_spec.js
spec/frontend/image_diff/replaced_image_diff_spec.js
+8
-8
spec/frontend/import_entities/import_groups/components/import_table_row_spec.js
...ntities/import_groups/components/import_table_row_spec.js
+3
-3
spec/frontend/import_entities/import_groups/graphql/client_factory_spec.js
...ort_entities/import_groups/graphql/client_factory_spec.js
+4
-4
spec/frontend/import_entities/import_projects/components/import_projects_table_spec.js
.../import_projects/components/import_projects_table_spec.js
+2
-2
spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js
...mport_projects/components/provider_repo_table_row_spec.js
+1
-1
spec/frontend/import_entities/import_projects/store/actions_spec.js
...end/import_entities/import_projects/store/actions_spec.js
+1
-1
spec/frontend/incidents_settings/components/incidents_settings_tabs_spec.js
...dents_settings/components/incidents_settings_tabs_spec.js
+1
-1
spec/frontend/integrations/edit/components/jira_issues_fields_spec.js
...d/integrations/edit/components/jira_issues_fields_spec.js
+1
-1
spec/frontend/integrations/edit/components/jira_trigger_fields_spec.js
.../integrations/edit/components/jira_trigger_fields_spec.js
+2
-2
spec/frontend/integrations/edit/components/trigger_fields_spec.js
...ntend/integrations/edit/components/trigger_fields_spec.js
+1
-1
spec/frontend/issuable/related_issues/components/related_issues_block_spec.js
...le/related_issues/components/related_issues_block_spec.js
+2
-2
spec/frontend/issuable_show/components/issuable_body_spec.js
spec/frontend/issuable_show/components/issuable_body_spec.js
+1
-1
spec/frontend/issuable_show/components/issuable_edit_form_spec.js
...ntend/issuable_show/components/issuable_edit_form_spec.js
+1
-1
spec/frontend/issuable_show/components/issuable_header_spec.js
...frontend/issuable_show/components/issuable_header_spec.js
+1
-1
spec/frontend/issuable_show/components/issuable_show_root_spec.js
...ntend/issuable_show/components/issuable_show_root_spec.js
+1
-1
No files found.
.prettierignore
View file @
c35cc92c
...
...
@@ -1887,41 +1887,6 @@ spec/frontend/helpers/vuex_action_helper_spec.js
spec/frontend/helpers/wait_for_promises.js
spec/frontend/helpers/wait_using_real_timer.js
## angry-bhabha
spec/frontend/ide/stores/modules/branches/actions_spec.js
spec/frontend/ide/stores/modules/branches/mutations_spec.js
spec/frontend/ide/stores/modules/clientside/actions_spec.js
spec/frontend/ide/stores/modules/commit/actions_spec.js
spec/frontend/ide/stores/modules/commit/getters_spec.js
spec/frontend/ide/stores/modules/file_templates/actions_spec.js
spec/frontend/ide/stores/modules/merge_requests/actions_spec.js
spec/frontend/ide/stores/modules/pane/actions_spec.js
spec/frontend/ide/stores/modules/pipelines/actions_spec.js
spec/frontend/ide/stores/modules/pipelines/mutations_spec.js
spec/frontend/ide/stores/modules/terminal/actions/checks_spec.js
spec/frontend/ide/stores/modules/terminal/actions/session_controls_spec.js
spec/frontend/ide/stores/modules/terminal/actions/session_status_spec.js
spec/frontend/ide/stores/modules/terminal_sync/actions_spec.js
spec/frontend/ide/stores/mutations/file_spec.js
spec/frontend/ide/sync_router_and_store_spec.js
spec/frontend/ide/utils_spec.js
spec/frontend/image_diff/init_discussion_tab_spec.js
spec/frontend/image_diff/replaced_image_diff_spec.js
spec/frontend/import_entities/import_groups/components/import_table_row_spec.js
spec/frontend/import_entities/import_groups/graphql/client_factory_spec.js
spec/frontend/import_entities/import_projects/components/import_projects_table_spec.js
spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js
spec/frontend/import_entities/import_projects/store/actions_spec.js
spec/frontend/incidents_settings/components/incidents_settings_tabs_spec.js
spec/frontend/integrations/edit/components/jira_issues_fields_spec.js
spec/frontend/integrations/edit/components/jira_trigger_fields_spec.js
spec/frontend/integrations/edit/components/trigger_fields_spec.js
spec/frontend/issuable/related_issues/components/related_issues_block_spec.js
spec/frontend/issuable_show/components/issuable_body_spec.js
spec/frontend/issuable_show/components/issuable_edit_form_spec.js
spec/frontend/issuable_show/components/issuable_header_spec.js
spec/frontend/issuable_show/components/issuable_show_root_spec.js
## practical-murdock
spec/frontend/issuable_spec.js
spec/frontend/issue_show/components/app_spec.js
...
...
spec/frontend/ide/stores/modules/branches/actions_spec.js
View file @
c35cc92c
...
...
@@ -42,7 +42,7 @@ describe('IDE branches actions', () => {
});
describe
(
'
requestBranches
'
,
()
=>
{
it
(
'
should commit request
'
,
done
=>
{
it
(
'
should commit request
'
,
(
done
)
=>
{
testAction
(
requestBranches
,
null
,
...
...
@@ -55,7 +55,7 @@ describe('IDE branches actions', () => {
});
describe
(
'
receiveBranchesError
'
,
()
=>
{
it
(
'
should commit error
'
,
done
=>
{
it
(
'
should commit error
'
,
(
done
)
=>
{
testAction
(
receiveBranchesError
,
{
search
:
TEST_SEARCH
},
...
...
@@ -78,7 +78,7 @@ describe('IDE branches actions', () => {
});
describe
(
'
receiveBranchesSuccess
'
,
()
=>
{
it
(
'
should commit received data
'
,
done
=>
{
it
(
'
should commit received data
'
,
(
done
)
=>
{
testAction
(
receiveBranchesSuccess
,
branches
,
...
...
@@ -110,7 +110,7 @@ describe('IDE branches actions', () => {
});
});
it
(
'
dispatches success with received data
'
,
done
=>
{
it
(
'
dispatches success with received data
'
,
(
done
)
=>
{
testAction
(
fetchBranches
,
{
search
:
TEST_SEARCH
},
...
...
@@ -131,7 +131,7 @@ describe('IDE branches actions', () => {
mock
.
onGet
(
/
\/
api
\/
v4
\/
projects
\/\d
+
\/
repository
\/
branches
(
.*
)
$/
).
replyOnce
(
500
);
});
it
(
'
dispatches error
'
,
done
=>
{
it
(
'
dispatches error
'
,
(
done
)
=>
{
testAction
(
fetchBranches
,
{
search
:
TEST_SEARCH
},
...
...
@@ -148,7 +148,7 @@ describe('IDE branches actions', () => {
});
describe
(
'
resetBranches
'
,
()
=>
{
it
(
'
commits reset
'
,
done
=>
{
it
(
'
commits reset
'
,
(
done
)
=>
{
testAction
(
resetBranches
,
null
,
...
...
spec/frontend/ide/stores/modules/branches/mutations_spec.js
View file @
c35cc92c
...
...
@@ -28,7 +28,7 @@ describe('IDE branches mutations', () => {
describe
(
'
RECEIVE_BRANCHES_SUCCESS
'
,
()
=>
{
it
(
'
sets branches
'
,
()
=>
{
const
expectedBranches
=
branches
.
map
(
branch
=>
({
const
expectedBranches
=
branches
.
map
(
(
branch
)
=>
({
name
:
branch
.
name
,
committedDate
:
branch
.
commit
.
committed_date
,
}));
...
...
spec/frontend/ide/stores/modules/clientside/actions_spec.js
View file @
c35cc92c
...
...
@@ -25,7 +25,7 @@ describe('IDE store module clientside actions', () => {
});
describe
(
'
pingUsage
'
,
()
=>
{
it
(
'
posts to usage endpoint
'
,
done
=>
{
it
(
'
posts to usage endpoint
'
,
(
done
)
=>
{
const
usageSpy
=
jest
.
fn
(()
=>
[
200
]);
mock
.
onPost
(
TEST_USAGE_URL
).
reply
(()
=>
usageSpy
());
...
...
spec/frontend/ide/stores/modules/commit/actions_spec.js
View file @
c35cc92c
...
...
@@ -41,7 +41,7 @@ describe('IDE commit module actions', () => {
});
describe
(
'
updateCommitMessage
'
,
()
=>
{
it
(
'
updates store with new commit message
'
,
done
=>
{
it
(
'
updates store with new commit message
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/updateCommitMessage
'
,
'
testing
'
)
.
then
(()
=>
{
...
...
@@ -53,7 +53,7 @@ describe('IDE commit module actions', () => {
});
describe
(
'
discardDraft
'
,
()
=>
{
it
(
'
resets commit message to blank
'
,
done
=>
{
it
(
'
resets commit message to blank
'
,
(
done
)
=>
{
store
.
state
.
commit
.
commitMessage
=
'
testing
'
;
store
...
...
@@ -67,7 +67,7 @@ describe('IDE commit module actions', () => {
});
describe
(
'
updateCommitAction
'
,
()
=>
{
it
(
'
updates store with new commit action
'
,
done
=>
{
it
(
'
updates store with new commit action
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/updateCommitAction
'
,
'
1
'
)
.
then
(()
=>
{
...
...
@@ -123,7 +123,7 @@ describe('IDE commit module actions', () => {
});
});
it
(
'
updates commit message with short_id
'
,
done
=>
{
it
(
'
updates commit message with short_id
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/setLastCommitMessage
'
,
{
short_id
:
'
123
'
})
.
then
(()
=>
{
...
...
@@ -135,7 +135,7 @@ describe('IDE commit module actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'
updates commit message with stats
'
,
done
=>
{
it
(
'
updates commit message with stats
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/setLastCommitMessage
'
,
{
short_id
:
'
123
'
,
...
...
@@ -200,12 +200,12 @@ describe('IDE commit module actions', () => {
});
store
.
state
.
openFiles
=
store
.
state
.
stagedFiles
;
store
.
state
.
stagedFiles
.
forEach
(
stagedFile
=>
{
store
.
state
.
stagedFiles
.
forEach
(
(
stagedFile
)
=>
{
store
.
state
.
entries
[
stagedFile
.
path
]
=
stagedFile
;
});
});
it
(
'
updates stores working reference
'
,
done
=>
{
it
(
'
updates stores working reference
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/updateFilesAfterCommit
'
,
{
data
,
...
...
@@ -218,14 +218,14 @@ describe('IDE commit module actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'
resets all files changed status
'
,
done
=>
{
it
(
'
resets all files changed status
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/updateFilesAfterCommit
'
,
{
data
,
branch
,
})
.
then
(()
=>
{
store
.
state
.
openFiles
.
forEach
(
entry
=>
{
store
.
state
.
openFiles
.
forEach
(
(
entry
)
=>
{
expect
(
entry
.
changed
).
toBeFalsy
();
});
})
...
...
@@ -233,7 +233,7 @@ describe('IDE commit module actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'
sets files commit data
'
,
done
=>
{
it
(
'
sets files commit data
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/updateFilesAfterCommit
'
,
{
data
,
...
...
@@ -246,7 +246,7 @@ describe('IDE commit module actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'
updates raw content for changed file
'
,
done
=>
{
it
(
'
updates raw content for changed file
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/updateFilesAfterCommit
'
,
{
data
,
...
...
@@ -259,7 +259,7 @@ describe('IDE commit module actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'
emits changed event for file
'
,
done
=>
{
it
(
'
emits changed event for file
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/updateFilesAfterCommit
'
,
{
data
,
...
...
@@ -319,7 +319,7 @@ describe('IDE commit module actions', () => {
store
.
state
.
commit
.
commitAction
=
'
2
'
;
store
.
state
.
commit
.
commitMessage
=
'
testing 123
'
;
store
.
state
.
openFiles
.
forEach
(
localF
=>
{
store
.
state
.
openFiles
.
forEach
(
(
localF
)
=>
{
store
.
state
.
entries
[
localF
.
path
]
=
localF
;
});
});
...
...
@@ -345,7 +345,7 @@ describe('IDE commit module actions', () => {
jest
.
spyOn
(
service
,
'
commit
'
).
mockResolvedValue
({
data
:
COMMIT_RESPONSE
});
});
it
(
'
calls service
'
,
done
=>
{
it
(
'
calls service
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/commitChanges
'
)
.
then
(()
=>
{
...
...
@@ -370,7 +370,7 @@ describe('IDE commit module actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'
sends lastCommit ID when not creating new branch
'
,
done
=>
{
it
(
'
sends lastCommit ID when not creating new branch
'
,
(
done
)
=>
{
store
.
state
.
commit
.
commitAction
=
'
1
'
;
store
...
...
@@ -397,7 +397,7 @@ describe('IDE commit module actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'
sets last Commit Msg
'
,
done
=>
{
it
(
'
sets last Commit Msg
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/commitChanges
'
)
.
then
(()
=>
{
...
...
@@ -410,7 +410,7 @@ describe('IDE commit module actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'
adds commit data to files
'
,
done
=>
{
it
(
'
adds commit data to files
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/commitChanges
'
)
.
then
(()
=>
{
...
...
@@ -423,7 +423,7 @@ describe('IDE commit module actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'
resets stores commit actions
'
,
done
=>
{
it
(
'
resets stores commit actions
'
,
(
done
)
=>
{
store
.
state
.
commit
.
commitAction
=
consts
.
COMMIT_TO_NEW_BRANCH
;
store
...
...
@@ -435,7 +435,7 @@ describe('IDE commit module actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'
removes all staged files
'
,
done
=>
{
it
(
'
removes all staged files
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/commitChanges
'
)
.
then
(()
=>
{
...
...
@@ -446,7 +446,7 @@ describe('IDE commit module actions', () => {
});
describe
(
'
merge request
'
,
()
=>
{
it
(
'
redirects to new merge request page
'
,
done
=>
{
it
(
'
redirects to new merge request page
'
,
(
done
)
=>
{
jest
.
spyOn
(
eventHub
,
'
$on
'
).
mockImplementation
();
store
.
state
.
commit
.
commitAction
=
consts
.
COMMIT_TO_NEW_BRANCH
;
...
...
@@ -464,7 +464,7 @@ describe('IDE commit module actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'
does not redirect to new merge request page when shouldCreateMR is not checked
'
,
done
=>
{
it
(
'
does not redirect to new merge request page when shouldCreateMR is not checked
'
,
(
done
)
=>
{
jest
.
spyOn
(
eventHub
,
'
$on
'
).
mockImplementation
();
store
.
state
.
commit
.
commitAction
=
consts
.
COMMIT_TO_NEW_BRANCH
;
...
...
@@ -510,7 +510,7 @@ describe('IDE commit module actions', () => {
});
});
it
(
'
shows failed message
'
,
done
=>
{
it
(
'
shows failed message
'
,
(
done
)
=>
{
store
.
dispatch
(
'
commit/commitChanges
'
)
.
then
(()
=>
{
...
...
@@ -556,7 +556,7 @@ describe('IDE commit module actions', () => {
},
};
it
(
'
commits TOGGLE_EMPTY_STATE mutation on empty repo
'
,
done
=>
{
it
(
'
commits TOGGLE_EMPTY_STATE mutation on empty repo
'
,
(
done
)
=>
{
jest
.
spyOn
(
service
,
'
commit
'
).
mockResolvedValue
({
data
:
COMMIT_RESPONSE
});
jest
.
spyOn
(
store
,
'
commit
'
);
...
...
@@ -573,7 +573,7 @@ describe('IDE commit module actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'
does not commmit TOGGLE_EMPTY_STATE mutation on existing project
'
,
done
=>
{
it
(
'
does not commmit TOGGLE_EMPTY_STATE mutation on existing project
'
,
(
done
)
=>
{
COMMIT_RESPONSE
.
parent_ids
.
push
(
'
1234
'
);
jest
.
spyOn
(
service
,
'
commit
'
).
mockResolvedValue
({
data
:
COMMIT_RESPONSE
});
jest
.
spyOn
(
store
,
'
commit
'
);
...
...
@@ -594,7 +594,7 @@ describe('IDE commit module actions', () => {
});
describe
(
'
toggleShouldCreateMR
'
,
()
=>
{
it
(
'
commits both toggle and interacting with MR checkbox actions
'
,
done
=>
{
it
(
'
commits both toggle and interacting with MR checkbox actions
'
,
(
done
)
=>
{
testAction
(
actions
.
toggleShouldCreateMR
,
{},
...
...
spec/frontend/ide/stores/modules/commit/getters_spec.js
View file @
c35cc92c
...
...
@@ -103,7 +103,7 @@ describe('IDE commit module getters', () => {
expect
(
getters
.
preBuiltCommitMessage
(
state
,
null
,
rootState
)).
toBe
(
'
test commit message
'
);
});
[
'
changedFiles
'
,
'
stagedFiles
'
].
forEach
(
key
=>
{
[
'
changedFiles
'
,
'
stagedFiles
'
].
forEach
(
(
key
)
=>
{
it
(
'
returns commitMessage with updated file
'
,
()
=>
{
rootState
[
key
].
push
({
path
:
'
test-file
'
,
...
...
spec/frontend/ide/stores/modules/file_templates/actions_spec.js
View file @
c35cc92c
...
...
@@ -20,7 +20,7 @@ describe('IDE file templates actions', () => {
});
describe
(
'
requestTemplateTypes
'
,
()
=>
{
it
(
'
commits REQUEST_TEMPLATE_TYPES
'
,
done
=>
{
it
(
'
commits REQUEST_TEMPLATE_TYPES
'
,
(
done
)
=>
{
testAction
(
actions
.
requestTemplateTypes
,
null
,
...
...
@@ -33,7 +33,7 @@ describe('IDE file templates actions', () => {
});
describe
(
'
receiveTemplateTypesError
'
,
()
=>
{
it
(
'
commits RECEIVE_TEMPLATE_TYPES_ERROR and dispatches setErrorMessage
'
,
done
=>
{
it
(
'
commits RECEIVE_TEMPLATE_TYPES_ERROR and dispatches setErrorMessage
'
,
(
done
)
=>
{
testAction
(
actions
.
receiveTemplateTypesError
,
null
,
...
...
@@ -55,7 +55,7 @@ describe('IDE file templates actions', () => {
});
describe
(
'
receiveTemplateTypesSuccess
'
,
()
=>
{
it
(
'
commits RECEIVE_TEMPLATE_TYPES_SUCCESS
'
,
done
=>
{
it
(
'
commits RECEIVE_TEMPLATE_TYPES_SUCCESS
'
,
(
done
)
=>
{
testAction
(
actions
.
receiveTemplateTypesSuccess
,
'
test
'
,
...
...
@@ -81,7 +81,7 @@ describe('IDE file templates actions', () => {
});
});
it
(
'
rejects if selectedTemplateType is empty
'
,
done
=>
{
it
(
'
rejects if selectedTemplateType is empty
'
,
(
done
)
=>
{
const
dispatch
=
jest
.
fn
().
mockName
(
'
dispatch
'
);
actions
...
...
@@ -94,7 +94,7 @@ describe('IDE file templates actions', () => {
});
});
it
(
'
dispatches actions
'
,
done
=>
{
it
(
'
dispatches actions
'
,
(
done
)
=>
{
state
.
selectedTemplateType
=
{
key
:
'
licenses
'
};
testAction
(
...
...
@@ -121,7 +121,7 @@ describe('IDE file templates actions', () => {
mock
.
onGet
(
/api
\/(
.*
)\/
templates
\/
licenses/
).
replyOnce
(
500
);
});
it
(
'
dispatches actions
'
,
done
=>
{
it
(
'
dispatches actions
'
,
(
done
)
=>
{
state
.
selectedTemplateType
=
{
key
:
'
licenses
'
};
testAction
(
...
...
@@ -184,7 +184,7 @@ describe('IDE file templates actions', () => {
});
describe
(
'
receiveTemplateError
'
,
()
=>
{
it
(
'
dispatches setErrorMessage
'
,
done
=>
{
it
(
'
dispatches setErrorMessage
'
,
(
done
)
=>
{
testAction
(
actions
.
receiveTemplateError
,
'
test
'
,
...
...
@@ -217,7 +217,7 @@ describe('IDE file templates actions', () => {
.
replyOnce
(
200
,
{
content
:
'
testing content
'
});
});
it
(
'
dispatches setFileTemplate if template already has content
'
,
done
=>
{
it
(
'
dispatches setFileTemplate if template already has content
'
,
(
done
)
=>
{
const
template
=
{
content
:
'
already has content
'
};
testAction
(
...
...
@@ -230,7 +230,7 @@ describe('IDE file templates actions', () => {
);
});
it
(
'
dispatches success
'
,
done
=>
{
it
(
'
dispatches success
'
,
(
done
)
=>
{
const
template
=
{
key
:
'
mit
'
};
state
.
selectedTemplateType
=
{
key
:
'
licenses
'
};
...
...
@@ -245,7 +245,7 @@ describe('IDE file templates actions', () => {
);
});
it
(
'
dispatches success and uses name key for API call
'
,
done
=>
{
it
(
'
dispatches success and uses name key for API call
'
,
(
done
)
=>
{
const
template
=
{
name
:
'
testing
'
};
state
.
selectedTemplateType
=
{
key
:
'
licenses
'
};
...
...
@@ -266,7 +266,7 @@ describe('IDE file templates actions', () => {
mock
.
onGet
(
/api
\/(
.*
)\/
templates
\/
licenses
\/
mit/
).
replyOnce
(
500
);
});
it
(
'
dispatches error
'
,
done
=>
{
it
(
'
dispatches error
'
,
(
done
)
=>
{
const
template
=
{
name
:
'
testing
'
};
state
.
selectedTemplateType
=
{
key
:
'
licenses
'
};
...
...
spec/frontend/ide/stores/modules/merge_requests/actions_spec.js
View file @
c35cc92c
...
...
@@ -28,7 +28,7 @@ describe('IDE merge requests actions', () => {
});
describe
(
'
requestMergeRequests
'
,
()
=>
{
it
(
'
should commit request
'
,
done
=>
{
it
(
'
should commit request
'
,
(
done
)
=>
{
testAction
(
requestMergeRequests
,
null
,
...
...
@@ -41,7 +41,7 @@ describe('IDE merge requests actions', () => {
});
describe
(
'
receiveMergeRequestsError
'
,
()
=>
{
it
(
'
should commit error
'
,
done
=>
{
it
(
'
should commit error
'
,
(
done
)
=>
{
testAction
(
receiveMergeRequestsError
,
{
type
:
'
created
'
,
search
:
''
},
...
...
@@ -64,7 +64,7 @@ describe('IDE merge requests actions', () => {
});
describe
(
'
receiveMergeRequestsSuccess
'
,
()
=>
{
it
(
'
should commit received data
'
,
done
=>
{
it
(
'
should commit received data
'
,
(
done
)
=>
{
testAction
(
receiveMergeRequestsSuccess
,
mergeRequests
,
...
...
@@ -118,7 +118,7 @@ describe('IDE merge requests actions', () => {
});
});
it
(
'
dispatches success with received data
'
,
done
=>
{
it
(
'
dispatches success with received data
'
,
(
done
)
=>
{
testAction
(
fetchMergeRequests
,
{
type
:
'
created
'
},
...
...
@@ -156,7 +156,7 @@ describe('IDE merge requests actions', () => {
);
});
it
(
'
dispatches success with received data
'
,
done
=>
{
it
(
'
dispatches success with received data
'
,
(
done
)
=>
{
testAction
(
fetchMergeRequests
,
{
type
:
null
},
...
...
@@ -177,7 +177,7 @@ describe('IDE merge requests actions', () => {
mock
.
onGet
(
/
\/
api
\/
v4
\/
merge_requests
(
.*
)
$/
).
replyOnce
(
500
);
});
it
(
'
dispatches error
'
,
done
=>
{
it
(
'
dispatches error
'
,
(
done
)
=>
{
testAction
(
fetchMergeRequests
,
{
type
:
'
created
'
,
search
:
''
},
...
...
@@ -195,7 +195,7 @@ describe('IDE merge requests actions', () => {
});
describe
(
'
resetMergeRequests
'
,
()
=>
{
it
(
'
commits reset
'
,
done
=>
{
it
(
'
commits reset
'
,
(
done
)
=>
{
testAction
(
resetMergeRequests
,
null
,
...
...
spec/frontend/ide/stores/modules/pane/actions_spec.js
View file @
c35cc92c
...
...
@@ -7,18 +7,18 @@ describe('IDE pane module actions', () => {
const
TEST_VIEW_KEEP_ALIVE
=
{
name
:
'
test-keep-alive
'
,
keepAlive
:
true
};
describe
(
'
toggleOpen
'
,
()
=>
{
it
(
'
dispatches open if closed
'
,
done
=>
{
it
(
'
dispatches open if closed
'
,
(
done
)
=>
{
testAction
(
actions
.
toggleOpen
,
TEST_VIEW
,
{
isOpen
:
false
},
[],
[{
type
:
'
open
'
}],
done
);
});
it
(
'
dispatches close if opened
'
,
done
=>
{
it
(
'
dispatches close if opened
'
,
(
done
)
=>
{
testAction
(
actions
.
toggleOpen
,
TEST_VIEW
,
{
isOpen
:
true
},
[],
[{
type
:
'
close
'
}],
done
);
});
});
describe
(
'
open
'
,
()
=>
{
describe
(
'
with a view specified
'
,
()
=>
{
it
(
'
commits SET_OPEN and SET_CURRENT_VIEW
'
,
done
=>
{
it
(
'
commits SET_OPEN and SET_CURRENT_VIEW
'
,
(
done
)
=>
{
testAction
(
actions
.
open
,
TEST_VIEW
,
...
...
@@ -32,7 +32,7 @@ describe('IDE pane module actions', () => {
);
});
it
(
'
commits KEEP_ALIVE_VIEW if keepAlive is true
'
,
done
=>
{
it
(
'
commits KEEP_ALIVE_VIEW if keepAlive is true
'
,
(
done
)
=>
{
testAction
(
actions
.
open
,
TEST_VIEW_KEEP_ALIVE
,
...
...
@@ -49,7 +49,7 @@ describe('IDE pane module actions', () => {
});
describe
(
'
without a view specified
'
,
()
=>
{
it
(
'
commits SET_OPEN
'
,
done
=>
{
it
(
'
commits SET_OPEN
'
,
(
done
)
=>
{
testAction
(
actions
.
open
,
undefined
,
...
...
@@ -63,7 +63,7 @@ describe('IDE pane module actions', () => {
});
describe
(
'
close
'
,
()
=>
{
it
(
'
commits SET_OPEN
'
,
done
=>
{
it
(
'
commits SET_OPEN
'
,
(
done
)
=>
{
testAction
(
actions
.
close
,
null
,
{},
[{
type
:
types
.
SET_OPEN
,
payload
:
false
}],
[],
done
);
});
});
...
...
spec/frontend/ide/stores/modules/pipelines/actions_spec.js
View file @
c35cc92c
...
...
@@ -44,7 +44,7 @@ describe('IDE pipelines actions', () => {
});
describe
(
'
requestLatestPipeline
'
,
()
=>
{
it
(
'
commits request
'
,
done
=>
{
it
(
'
commits request
'
,
(
done
)
=>
{
testAction
(
requestLatestPipeline
,
null
,
...
...
@@ -57,7 +57,7 @@ describe('IDE pipelines actions', () => {
});
describe
(
'
receiveLatestPipelineError
'
,
()
=>
{
it
(
'
commits error
'
,
done
=>
{
it
(
'
commits error
'
,
(
done
)
=>
{
testAction
(
receiveLatestPipelineError
,
{
status
:
404
},
...
...
@@ -68,7 +68,7 @@ describe('IDE pipelines actions', () => {
);
});
it
(
'
dispatches setErrorMessage is not 404
'
,
done
=>
{
it
(
'
dispatches setErrorMessage is not 404
'
,
(
done
)
=>
{
testAction
(
receiveLatestPipelineError
,
{
status
:
500
},
...
...
@@ -123,7 +123,7 @@ describe('IDE pipelines actions', () => {
.
reply
(
200
,
{
data
:
{
foo
:
'
bar
'
}
},
{
'
poll-interval
'
:
'
10000
'
});
});
it
(
'
dispatches request
'
,
done
=>
{
it
(
'
dispatches request
'
,
(
done
)
=>
{
jest
.
spyOn
(
axios
,
'
get
'
);
jest
.
spyOn
(
Visibility
,
'
hidden
'
).
mockReturnValue
(
false
);
...
...
@@ -139,7 +139,7 @@ describe('IDE pipelines actions', () => {
jest
.
advanceTimersByTime
(
1000
);
new
Promise
(
resolve
=>
requestAnimationFrame
(
resolve
))
new
Promise
(
(
resolve
)
=>
requestAnimationFrame
(
resolve
))
.
then
(()
=>
{
expect
(
axios
.
get
).
toHaveBeenCalled
();
expect
(
axios
.
get
).
toHaveBeenCalledTimes
(
1
);
...
...
@@ -150,7 +150,7 @@ describe('IDE pipelines actions', () => {
jest
.
advanceTimersByTime
(
10000
);
})
.
then
(()
=>
new
Promise
(
resolve
=>
requestAnimationFrame
(
resolve
)))
.
then
(()
=>
new
Promise
(
(
resolve
)
=>
requestAnimationFrame
(
resolve
)))
.
then
(()
=>
{
expect
(
axios
.
get
).
toHaveBeenCalled
();
expect
(
axios
.
get
).
toHaveBeenCalledTimes
(
2
);
...
...
@@ -169,7 +169,7 @@ describe('IDE pipelines actions', () => {
mock
.
onGet
(
'
/abc/def/commit/abc123def456ghi789jkl/pipelines
'
).
reply
(
500
);
});
it
(
'
dispatches error
'
,
done
=>
{
it
(
'
dispatches error
'
,
(
done
)
=>
{
const
dispatch
=
jest
.
fn
().
mockName
(
'
dispatch
'
);
const
rootGetters
=
{
lastCommit
:
{
id
:
'
abc123def456ghi789jkl
'
},
...
...
@@ -180,7 +180,7 @@ describe('IDE pipelines actions', () => {
jest
.
advanceTimersByTime
(
1500
);
new
Promise
(
resolve
=>
requestAnimationFrame
(
resolve
))
new
Promise
(
(
resolve
)
=>
requestAnimationFrame
(
resolve
))
.
then
(()
=>
{
expect
(
dispatch
).
toHaveBeenCalledWith
(
'
receiveLatestPipelineError
'
,
expect
.
anything
());
})
...
...
@@ -191,13 +191,13 @@ describe('IDE pipelines actions', () => {
});
describe
(
'
requestJobs
'
,
()
=>
{
it
(
'
commits request
'
,
done
=>
{
it
(
'
commits request
'
,
(
done
)
=>
{
testAction
(
requestJobs
,
1
,
mockedState
,
[{
type
:
types
.
REQUEST_JOBS
,
payload
:
1
}],
[],
done
);
});
});
describe
(
'
receiveJobsError
'
,
()
=>
{
it
(
'
commits error
'
,
done
=>
{
it
(
'
commits error
'
,
(
done
)
=>
{
testAction
(
receiveJobsError
,
{
id
:
1
},
...
...
@@ -220,7 +220,7 @@ describe('IDE pipelines actions', () => {
});
describe
(
'
receiveJobsSuccess
'
,
()
=>
{
it
(
'
commits data
'
,
done
=>
{
it
(
'
commits data
'
,
(
done
)
=>
{
testAction
(
receiveJobsSuccess
,
{
id
:
1
,
data
:
jobs
},
...
...
@@ -240,7 +240,7 @@ describe('IDE pipelines actions', () => {
mock
.
onGet
(
stage
.
dropdownPath
).
replyOnce
(
200
,
jobs
);
});
it
(
'
dispatches request
'
,
done
=>
{
it
(
'
dispatches request
'
,
(
done
)
=>
{
testAction
(
fetchJobs
,
stage
,
...
...
@@ -260,7 +260,7 @@ describe('IDE pipelines actions', () => {
mock
.
onGet
(
stage
.
dropdownPath
).
replyOnce
(
500
);
});
it
(
'
dispatches error
'
,
done
=>
{
it
(
'
dispatches error
'
,
(
done
)
=>
{
testAction
(
fetchJobs
,
stage
,
...
...
@@ -277,7 +277,7 @@ describe('IDE pipelines actions', () => {
});
describe
(
'
toggleStageCollapsed
'
,
()
=>
{
it
(
'
commits collapse
'
,
done
=>
{
it
(
'
commits collapse
'
,
(
done
)
=>
{
testAction
(
toggleStageCollapsed
,
1
,
...
...
@@ -290,7 +290,7 @@ describe('IDE pipelines actions', () => {
});
describe
(
'
setDetailJob
'
,
()
=>
{
it
(
'
commits job
'
,
done
=>
{
it
(
'
commits job
'
,
(
done
)
=>
{
testAction
(
setDetailJob
,
'
job
'
,
...
...
@@ -301,7 +301,7 @@ describe('IDE pipelines actions', () => {
);
});
it
(
'
dispatches rightPane/open as pipeline when job is null
'
,
done
=>
{
it
(
'
dispatches rightPane/open as pipeline when job is null
'
,
(
done
)
=>
{
testAction
(
setDetailJob
,
null
,
...
...
@@ -312,7 +312,7 @@ describe('IDE pipelines actions', () => {
);
});
it
(
'
dispatches rightPane/open as job
'
,
done
=>
{
it
(
'
dispatches rightPane/open as job
'
,
(
done
)
=>
{
testAction
(
setDetailJob
,
'
job
'
,
...
...
@@ -325,13 +325,13 @@ describe('IDE pipelines actions', () => {
});
describe
(
'
requestJobLogs
'
,
()
=>
{
it
(
'
commits request
'
,
done
=>
{
it
(
'
commits request
'
,
(
done
)
=>
{
testAction
(
requestJobLogs
,
null
,
mockedState
,
[{
type
:
types
.
REQUEST_JOB_LOGS
}],
[],
done
);
});
});
describe
(
'
receiveJobLogsError
'
,
()
=>
{
it
(
'
commits error
'
,
done
=>
{
it
(
'
commits error
'
,
(
done
)
=>
{
testAction
(
receiveJobLogsError
,
null
,
...
...
@@ -354,7 +354,7 @@ describe('IDE pipelines actions', () => {
});
describe
(
'
receiveJobLogsSuccess
'
,
()
=>
{
it
(
'
commits data
'
,
done
=>
{
it
(
'
commits data
'
,
(
done
)
=>
{
testAction
(
receiveJobLogsSuccess
,
'
data
'
,
...
...
@@ -377,7 +377,7 @@ describe('IDE pipelines actions', () => {
mock
.
onGet
(
`
${
TEST_HOST
}
/project/builds/trace`
).
replyOnce
(
200
,
{
html
:
'
html
'
});
});
it
(
'
dispatches request
'
,
done
=>
{
it
(
'
dispatches request
'
,
(
done
)
=>
{
testAction
(
fetchJobLogs
,
null
,
...
...
@@ -408,7 +408,7 @@ describe('IDE pipelines actions', () => {
mock
.
onGet
(
`
${
TEST_HOST
}
/project/builds/trace`
).
replyOnce
(
500
);
});
it
(
'
dispatches error
'
,
done
=>
{
it
(
'
dispatches error
'
,
(
done
)
=>
{
testAction
(
fetchJobLogs
,
null
,
...
...
@@ -422,7 +422,7 @@ describe('IDE pipelines actions', () => {
});
describe
(
'
resetLatestPipeline
'
,
()
=>
{
it
(
'
commits reset mutations
'
,
done
=>
{
it
(
'
commits reset mutations
'
,
(
done
)
=>
{
testAction
(
resetLatestPipeline
,
null
,
...
...
spec/frontend/ide/stores/modules/pipelines/mutations_spec.js
View file @
c35cc92c
...
...
@@ -137,7 +137,7 @@ describe('IDE pipelines mutations', () => {
mutations
[
types
.
RECEIVE_JOBS_SUCCESS
](
mockedState
,
{
id
:
mockedState
.
stages
[
0
].
id
,
data
});
expect
(
mockedState
.
stages
[
0
].
jobs
.
length
).
toBe
(
jobs
.
length
);
expect
(
mockedState
.
stages
[
0
].
jobs
).
toEqual
(
jobs
.
map
(
job
=>
({
jobs
.
map
(
(
job
)
=>
({
id
:
job
.
id
,
name
:
job
.
name
,
status
:
job
.
status
,
...
...
spec/frontend/ide/stores/modules/terminal/actions/checks_spec.js
View file @
c35cc92c
...
...
@@ -102,7 +102,7 @@ describe('IDE store terminal check actions', () => {
);
});
[
httpStatus
.
FORBIDDEN
,
httpStatus
.
NOT_FOUND
].
forEach
(
status
=>
{
[
httpStatus
.
FORBIDDEN
,
httpStatus
.
NOT_FOUND
].
forEach
(
(
status
)
=>
{
it
(
`hides tab, when status is
${
status
}
`
,
()
=>
{
const
payload
=
{
response
:
{
status
}
};
...
...
spec/frontend/ide/stores/modules/terminal/actions/session_controls_spec.js
View file @
c35cc92c
...
...
@@ -281,7 +281,7 @@ describe('IDE store terminal session controls actions', () => {
);
});
[
httpStatus
.
NOT_FOUND
,
httpStatus
.
UNPROCESSABLE_ENTITY
].
forEach
(
status
=>
{
[
httpStatus
.
NOT_FOUND
,
httpStatus
.
UNPROCESSABLE_ENTITY
].
forEach
(
(
status
)
=>
{
it
(
`dispatches request and startSession on
${
status
}
`
,
()
=>
{
mock
.
onPost
(
state
.
session
.
retryPath
,
{
branch
:
rootState
.
currentBranchId
,
format
:
'
json
'
})
...
...
spec/frontend/ide/stores/modules/terminal/actions/session_status_spec.js
View file @
c35cc92c
...
...
@@ -98,7 +98,7 @@ describe('IDE store terminal session controls actions', () => {
);
});
[
STOPPING
,
STOPPED
,
'
unexpected
'
].
forEach
(
status
=>
{
[
STOPPING
,
STOPPED
,
'
unexpected
'
].
forEach
(
(
status
)
=>
{
it
(
`kills session if status is
${
status
}
`
,
()
=>
{
return
testAction
(
actions
.
receiveSessionStatusSuccess
,
...
...
spec/frontend/ide/stores/modules/terminal_sync/actions_spec.js
View file @
c35cc92c
...
...
@@ -22,7 +22,7 @@ describe('ide/stores/modules/terminal_sync/actions', () => {
});
describe
(
'
upload
'
,
()
=>
{
it
(
'
uploads to mirror and sets success
'
,
done
=>
{
it
(
'
uploads to mirror and sets success
'
,
(
done
)
=>
{
mirror
.
upload
.
mockReturnValue
(
Promise
.
resolve
());
testAction
(
...
...
@@ -38,7 +38,7 @@ describe('ide/stores/modules/terminal_sync/actions', () => {
);
});
it
(
'
sets error when failed
'
,
done
=>
{
it
(
'
sets error when failed
'
,
(
done
)
=>
{
const
err
=
{
message
:
'
it failed!
'
};
mirror
.
upload
.
mockReturnValue
(
Promise
.
reject
(
err
));
...
...
@@ -54,7 +54,7 @@ describe('ide/stores/modules/terminal_sync/actions', () => {
});
describe
(
'
stop
'
,
()
=>
{
it
(
'
disconnects from mirror
'
,
done
=>
{
it
(
'
disconnects from mirror
'
,
(
done
)
=>
{
testAction
(
actions
.
stop
,
null
,
rootState
,
[{
type
:
types
.
STOP
}],
[],
()
=>
{
expect
(
mirror
.
disconnect
).
toHaveBeenCalled
();
done
();
...
...
@@ -83,7 +83,7 @@ describe('ide/stores/modules/terminal_sync/actions', () => {
};
});
it
(
'
connects to mirror and sets success
'
,
done
=>
{
it
(
'
connects to mirror and sets success
'
,
(
done
)
=>
{
mirror
.
connect
.
mockReturnValue
(
Promise
.
resolve
());
testAction
(
...
...
spec/frontend/ide/stores/mutations/file_spec.js
View file @
c35cc92c
...
...
@@ -128,7 +128,7 @@ describe('IDE store file mutations', () => {
localState
.
changedFiles
[
0
],
localState
.
openFiles
[
0
],
localFile
,
].
forEach
(
f
=>
{
].
forEach
(
(
f
)
=>
{
expect
(
f
).
toEqual
(
expect
.
objectContaining
({
path
,
...
...
@@ -142,7 +142,7 @@ describe('IDE store file mutations', () => {
});
describe
(
'
SET_FILE_RAW_DATA
'
,
()
=>
{
const
callMutationForFile
=
f
=>
{
const
callMutationForFile
=
(
f
)
=>
{
mutations
.
SET_FILE_RAW_DATA
(
localState
,
{
file
:
f
,
raw
:
'
testing
'
,
...
...
spec/frontend/ide/sync_router_and_store_spec.js
View file @
c35cc92c
...
...
@@ -17,7 +17,7 @@ describe('~/ide/sync_router_and_store', () => {
const
getRouterCurrentPath
=
()
=>
router
.
currentRoute
.
fullPath
;
const
getStoreCurrentPath
=
()
=>
store
.
state
.
router
.
fullPath
;
const
updateRouter
=
async
path
=>
{
const
updateRouter
=
async
(
path
)
=>
{
if
(
getRouterCurrentPath
()
===
path
)
{
return
;
}
...
...
@@ -25,7 +25,7 @@ describe('~/ide/sync_router_and_store', () => {
router
.
push
(
path
);
await
waitForPromises
();
};
const
updateStore
=
path
=>
{
const
updateStore
=
(
path
)
=>
{
store
.
dispatch
(
'
router/push
'
,
path
);
return
waitForPromises
();
};
...
...
spec/frontend/ide/utils_spec.js
View file @
c35cc92c
...
...
@@ -263,7 +263,7 @@ describe('WebIDE utils', () => {
it
(
'
reads a file and returns its output as a data url
'
,
()
=>
{
const
file
=
new
File
([
'
foo
'
],
'
foo.png
'
,
{
type
:
'
image/png
'
});
return
readFileAsDataURL
(
file
).
then
(
contents
=>
{
return
readFileAsDataURL
(
file
).
then
(
(
contents
)
=>
{
expect
(
contents
).
toBe
(
'
data:image/png;base64,Zm9v
'
);
});
});
...
...
spec/frontend/image_diff/init_discussion_tab_spec.js
View file @
c35cc92c
...
...
@@ -11,7 +11,7 @@ describe('initDiscussionTab', () => {
`
);
});
it
(
'
should pass canCreateNote as false to initImageDiff
'
,
done
=>
{
it
(
'
should pass canCreateNote as false to initImageDiff
'
,
(
done
)
=>
{
jest
.
spyOn
(
initImageDiffHelper
,
'
initImageDiff
'
)
.
mockImplementation
((
diffFileEl
,
canCreateNote
)
=>
{
...
...
@@ -22,7 +22,7 @@ describe('initDiscussionTab', () => {
initDiscussionTab
();
});
it
(
'
should pass renderCommentBadge as true to initImageDiff
'
,
done
=>
{
it
(
'
should pass renderCommentBadge as true to initImageDiff
'
,
(
done
)
=>
{
jest
.
spyOn
(
initImageDiffHelper
,
'
initImageDiff
'
)
.
mockImplementation
((
diffFileEl
,
canCreateNote
,
renderCommentBadge
)
=>
{
...
...
spec/frontend/image_diff/replaced_image_diff_spec.js
View file @
c35cc92c
...
...
@@ -176,8 +176,8 @@ describe('ReplacedImageDiff', () => {
expect
(
ImageDiff
.
prototype
.
bindEvents
).
toHaveBeenCalled
();
});
it
(
'
should register click eventlistener to 2-up view mode
'
,
done
=>
{
jest
.
spyOn
(
ReplacedImageDiff
.
prototype
,
'
changeView
'
).
mockImplementation
(
viewMode
=>
{
it
(
'
should register click eventlistener to 2-up view mode
'
,
(
done
)
=>
{
jest
.
spyOn
(
ReplacedImageDiff
.
prototype
,
'
changeView
'
).
mockImplementation
(
(
viewMode
)
=>
{
expect
(
viewMode
).
toEqual
(
viewTypes
.
TWO_UP
);
done
();
});
...
...
@@ -186,8 +186,8 @@ describe('ReplacedImageDiff', () => {
replacedImageDiff
.
viewModesEls
[
viewTypes
.
TWO_UP
].
click
();
});
it
(
'
should register click eventlistener to swipe view mode
'
,
done
=>
{
jest
.
spyOn
(
ReplacedImageDiff
.
prototype
,
'
changeView
'
).
mockImplementation
(
viewMode
=>
{
it
(
'
should register click eventlistener to swipe view mode
'
,
(
done
)
=>
{
jest
.
spyOn
(
ReplacedImageDiff
.
prototype
,
'
changeView
'
).
mockImplementation
(
(
viewMode
)
=>
{
expect
(
viewMode
).
toEqual
(
viewTypes
.
SWIPE
);
done
();
});
...
...
@@ -196,8 +196,8 @@ describe('ReplacedImageDiff', () => {
replacedImageDiff
.
viewModesEls
[
viewTypes
.
SWIPE
].
click
();
});
it
(
'
should register click eventlistener to onion skin view mode
'
,
done
=>
{
jest
.
spyOn
(
ReplacedImageDiff
.
prototype
,
'
changeView
'
).
mockImplementation
(
viewMode
=>
{
it
(
'
should register click eventlistener to onion skin view mode
'
,
(
done
)
=>
{
jest
.
spyOn
(
ReplacedImageDiff
.
prototype
,
'
changeView
'
).
mockImplementation
(
(
viewMode
)
=>
{
expect
(
viewMode
).
toEqual
(
viewTypes
.
SWIPE
);
done
();
});
...
...
@@ -325,7 +325,7 @@ describe('ReplacedImageDiff', () => {
setupImageFrameEls
();
});
it
(
'
should pass showCommentIndicator normalized indicator values
'
,
done
=>
{
it
(
'
should pass showCommentIndicator normalized indicator values
'
,
(
done
)
=>
{
jest
.
spyOn
(
imageDiffHelper
,
'
showCommentIndicator
'
).
mockImplementation
(()
=>
{});
jest
.
spyOn
(
imageDiffHelper
,
'
resizeCoordinatesToImageElement
'
)
...
...
@@ -339,7 +339,7 @@ describe('ReplacedImageDiff', () => {
replacedImageDiff
.
renderNewView
(
indicator
);
});
it
(
'
should call showCommentIndicator
'
,
done
=>
{
it
(
'
should call showCommentIndicator
'
,
(
done
)
=>
{
const
normalized
=
{
normalized
:
true
,
};
...
...
spec/frontend/import_entities/import_groups/components/import_table_row_spec.js
View file @
c35cc92c
...
...
@@ -5,7 +5,7 @@ import ImportTableRow from '~/import_entities/import_groups/components/import_ta
import
{
STATUSES
}
from
'
~/import_entities/constants
'
;
import
{
availableNamespacesFixture
}
from
'
../graphql/fixtures
'
;
const
getFakeGroup
=
status
=>
({
const
getFakeGroup
=
(
status
)
=>
({
web_url
:
'
https://fake.host/
'
,
full_path
:
'
fake_group_1
'
,
full_name
:
'
fake_name_1
'
,
...
...
@@ -22,13 +22,13 @@ describe('import table row', () => {
let
group
;
const
findByText
=
(
cmp
,
text
)
=>
{
return
wrapper
.
findAll
(
cmp
).
wrappers
.
find
(
node
=>
node
.
text
().
indexOf
(
text
)
===
0
);
return
wrapper
.
findAll
(
cmp
).
wrappers
.
find
(
(
node
)
=>
node
.
text
().
indexOf
(
text
)
===
0
);
};
const
findImportButton
=
()
=>
findByText
(
GlButton
,
'
Import
'
);
const
findNameInput
=
()
=>
wrapper
.
find
(
GlFormInput
);
const
findNamespaceDropdown
=
()
=>
wrapper
.
find
(
Select2Select
);
const
createComponent
=
props
=>
{
const
createComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
ImportTableRow
,
{
propsData
:
{
availableNamespaces
:
availableNamespacesFixture
,
...
...
spec/frontend/import_entities/import_groups/graphql/client_factory_spec.js
View file @
c35cc92c
...
...
@@ -63,7 +63,7 @@ describe('Bulk import resolvers', () => {
});
it
(
'
mirrors REST endpoint response fields
'
,
()
=>
{
const
extractRelevantFields
=
obj
=>
({
id
:
obj
.
id
,
full_path
:
obj
.
full_path
});
const
extractRelevantFields
=
(
obj
)
=>
({
id
:
obj
.
id
,
full_path
:
obj
.
full_path
});
expect
(
results
.
map
(
extractRelevantFields
)).
toStrictEqual
(
availableNamespacesFixture
.
map
(
extractRelevantFields
),
...
...
@@ -89,20 +89,20 @@ describe('Bulk import resolvers', () => {
expect
(
results
.
every
((
r
,
idx
)
=>
MIRRORED_FIELDS
.
every
(
field
=>
r
[
field
]
===
statusEndpointFixture
.
importable_data
[
idx
][
field
],
(
field
)
=>
r
[
field
]
===
statusEndpointFixture
.
importable_data
[
idx
][
field
],
),
),
).
toBe
(
true
);
});
it
(
'
populates each result instance with status field default to none
'
,
()
=>
{
expect
(
results
.
every
(
r
=>
r
.
status
===
STATUSES
.
NONE
)).
toBe
(
true
);
expect
(
results
.
every
(
(
r
)
=>
r
.
status
===
STATUSES
.
NONE
)).
toBe
(
true
);
});
it
(
'
populates each result instance with import_target defaulted to first available namespace
'
,
()
=>
{
expect
(
results
.
every
(
r
=>
r
.
import_target
.
target_namespace
===
availableNamespacesFixture
[
0
].
full_path
,
(
r
)
=>
r
.
import_target
.
target_namespace
===
availableNamespacesFixture
[
0
].
full_path
,
),
).
toBe
(
true
);
});
...
...
spec/frontend/import_entities/import_projects/components/import_projects_table_spec.js
View file @
c35cc92c
...
...
@@ -27,7 +27,7 @@ describe('ImportProjectsTable', () => {
const
findImportAllButton
=
()
=>
wrapper
.
findAll
(
GlButton
)
.
filter
(
w
=>
w
.
props
().
variant
===
'
success
'
)
.
filter
(
(
w
)
=>
w
.
props
().
variant
===
'
success
'
)
.
at
(
0
);
const
findImportAllModal
=
()
=>
wrapper
.
find
({
ref
:
'
importAllModal
'
});
...
...
@@ -112,7 +112,7 @@ describe('ImportProjectsTable', () => {
expect
(
wrapper
.
findAll
(
'
th
'
)
.
filter
(
w
=>
w
.
text
()
===
`From
${
providerTitle
}
`
)
.
filter
(
(
w
)
=>
w
.
text
()
===
`From
${
providerTitle
}
`
)
.
exists
(),
).
toBe
(
true
);
...
...
spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js
View file @
c35cc92c
...
...
@@ -34,7 +34,7 @@ describe('ProviderRepoTableRow', () => {
}
const
findImportButton
=
()
=>
{
const
buttons
=
wrapper
.
findAll
(
'
button
'
).
filter
(
node
=>
node
.
text
()
===
'
Import
'
);
const
buttons
=
wrapper
.
findAll
(
'
button
'
).
filter
(
(
node
)
=>
node
.
text
()
===
'
Import
'
);
return
buttons
.
length
?
buttons
.
at
(
0
)
:
buttons
;
};
...
...
spec/frontend/import_entities/import_projects/store/actions_spec.js
View file @
c35cc92c
...
...
@@ -123,7 +123,7 @@ describe('import_projects store actions', () => {
it
(
'
includes page in url query params
'
,
async
()
=>
{
let
requestedUrl
;
mock
.
onGet
().
reply
(
config
=>
{
mock
.
onGet
().
reply
(
(
config
)
=>
{
requestedUrl
=
config
.
url
;
return
[
200
,
payload
];
});
...
...
spec/frontend/incidents_settings/components/incidents_settings_tabs_spec.js
View file @
c35cc92c
...
...
@@ -39,7 +39,7 @@ describe('IncidentsSettingTabs', () => {
});
it
(
'
should render the tab for each active integration
'
,
()
=>
{
const
activeTabs
=
wrapper
.
vm
.
$options
.
tabs
.
filter
(
tab
=>
tab
.
active
);
const
activeTabs
=
wrapper
.
vm
.
$options
.
tabs
.
filter
(
(
tab
)
=>
tab
.
active
);
expect
(
findIntegrationTabs
().
length
).
toBe
(
activeTabs
.
length
);
activeTabs
.
forEach
((
tab
,
index
)
=>
{
expect
(
findIntegrationTabs
().
at
(
index
).
attributes
(
'
title
'
)).
toBe
(
tab
.
title
);
...
...
spec/frontend/integrations/edit/components/jira_issues_fields_spec.js
View file @
c35cc92c
...
...
@@ -12,7 +12,7 @@ describe('JiraIssuesFields', () => {
editProjectPath
:
'
/edit
'
,
};
const
createComponent
=
props
=>
{
const
createComponent
=
(
props
)
=>
{
wrapper
=
mount
(
JiraIssuesFields
,
{
propsData
:
{
...
defaultProps
,
...
props
},
});
...
...
spec/frontend/integrations/edit/components/jira_trigger_fields_spec.js
View file @
c35cc92c
...
...
@@ -104,11 +104,11 @@ describe('JiraTriggerFields', () => {
true
,
);
wrapper
.
findAll
(
'
[type=checkbox]
'
).
wrappers
.
forEach
(
checkbox
=>
{
wrapper
.
findAll
(
'
[type=checkbox]
'
).
wrappers
.
forEach
(
(
checkbox
)
=>
{
expect
(
checkbox
.
attributes
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
});
wrapper
.
findAll
(
'
[type=radio]
'
).
wrappers
.
forEach
(
radio
=>
{
wrapper
.
findAll
(
'
[type=radio]
'
).
wrappers
.
forEach
(
(
radio
)
=>
{
expect
(
radio
.
attributes
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
});
});
...
...
spec/frontend/integrations/edit/components/trigger_fields_spec.js
View file @
c35cc92c
...
...
@@ -29,7 +29,7 @@ describe('TriggerFields', () => {
const
findAllGlFormCheckboxes
=
()
=>
wrapper
.
findAll
(
GlFormCheckbox
);
const
findAllGlFormInputs
=
()
=>
wrapper
.
findAll
(
GlFormInput
);
describe
.
each
([
true
,
false
])(
'
template, isInheriting = `%p`
'
,
isInheriting
=>
{
describe
.
each
([
true
,
false
])(
'
template, isInheriting = `%p`
'
,
(
isInheriting
)
=>
{
it
(
'
renders a label with text "Trigger"
'
,
()
=>
{
createComponent
();
...
...
spec/frontend/issuable/related_issues/components/related_issues_block_spec.js
View file @
c35cc92c
...
...
@@ -130,8 +130,8 @@ describe('RelatedIssuesBlock', () => {
describe
(
'
showCategorizedIssues prop
'
,
()
=>
{
const
issueList
=
()
=>
wrapper
.
findAll
(
'
.js-related-issues-token-list-item
'
);
const
categorizedHeadings
=
()
=>
wrapper
.
findAll
(
'
h4
'
);
const
headingTextAt
=
index
=>
categorizedHeadings
().
at
(
index
).
text
();
const
mountComponent
=
showCategorizedIssues
=>
{
const
headingTextAt
=
(
index
)
=>
categorizedHeadings
().
at
(
index
).
text
();
const
mountComponent
=
(
showCategorizedIssues
)
=>
{
wrapper
=
mount
(
RelatedIssuesBlock
,
{
propsData
:
{
pathIdSeparator
:
PathIdSeparator
.
Issue
,
...
...
spec/frontend/issuable_show/components/issuable_body_spec.js
View file @
c35cc92c
...
...
@@ -135,7 +135,7 @@ describe('IssuableBody', () => {
it
.
each
([
'
keydown-title
'
,
'
keydown-description
'
])(
'
component emits `%s` event with event object and issuableMeta params via issuable-edit-form
'
,
async
eventName
=>
{
async
(
eventName
)
=>
{
const
eventObj
=
{
preventDefault
:
jest
.
fn
(),
stopPropagation
:
jest
.
fn
(),
...
...
spec/frontend/issuable_show/components/issuable_edit_form_spec.js
View file @
c35cc92c
...
...
@@ -28,7 +28,7 @@ const createComponent = ({ propsData = issuableEditFormProps } = {}) =>
describe
(
'
IssuableEditForm
'
,
()
=>
{
let
wrapper
;
const
assertEvent
=
eventSpy
=>
{
const
assertEvent
=
(
eventSpy
)
=>
{
expect
(
eventSpy
).
toHaveBeenNthCalledWith
(
1
,
'
update.issuable
'
,
expect
.
any
(
Function
));
expect
(
eventSpy
).
toHaveBeenNthCalledWith
(
2
,
'
close.form
'
,
expect
.
any
(
Function
));
};
...
...
spec/frontend/issuable_show/components/issuable_header_spec.js
View file @
c35cc92c
...
...
@@ -24,7 +24,7 @@ const createComponent = (propsData = issuableHeaderProps) =>
describe
(
'
IssuableHeader
'
,
()
=>
{
let
wrapper
;
const
findByTestId
=
testId
=>
wrapper
.
find
(
`[data-testid="
${
testId
}
"]`
);
const
findByTestId
=
(
testId
)
=>
wrapper
.
find
(
`[data-testid="
${
testId
}
"]`
);
beforeEach
(()
=>
{
wrapper
=
createComponent
();
...
...
spec/frontend/issuable_show/components/issuable_show_root_spec.js
View file @
c35cc92c
...
...
@@ -121,7 +121,7 @@ describe('IssuableShowRoot', () => {
it
.
each
([
'
keydown-title
'
,
'
keydown-description
'
])(
'
component emits `%s` event with event object and issuableMeta params via issuable-body
'
,
eventName
=>
{
(
eventName
)
=>
{
const
eventObj
=
{
preventDefault
:
jest
.
fn
(),
stopPropagation
:
jest
.
fn
(),
...
...
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