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
94cfbb0c
Commit
94cfbb0c
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 37 files - 67 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
b69f448f
Changes
37
Show whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
75 additions
and
75 deletions
+75
-75
spec/frontend/projects/experiment_new_project_creation/components/app_spec.js
...ts/experiment_new_project_creation/components/app_spec.js
+1
-1
spec/frontend/projects/experiment_new_project_creation/components/legacy_container_spec.js
..._new_project_creation/components/legacy_container_spec.js
+1
-1
spec/frontend/projects/experiment_new_project_creation/components/welcome_spec.js
...xperiment_new_project_creation/components/welcome_spec.js
+1
-1
spec/frontend/projects/project_import_gitlab_project_spec.js
spec/frontend/projects/project_import_gitlab_project_spec.js
+1
-1
spec/frontend/projects/settings/access_dropdown_spec.js
spec/frontend/projects/settings/access_dropdown_spec.js
+5
-5
spec/frontend/projects/settings_service_desk/services/service_desk_service_spec.js
...ttings_service_desk/services/service_desk_service_spec.js
+4
-4
spec/frontend/prometheus_metrics/prometheus_metrics_spec.js
spec/frontend/prometheus_metrics/prometheus_metrics_spec.js
+3
-3
spec/frontend/ref/components/ref_selector_spec.js
spec/frontend/ref/components/ref_selector_spec.js
+6
-6
spec/frontend/registry/explorer/components/delete_button_spec.js
...ontend/registry/explorer/components/delete_button_spec.js
+1
-1
spec/frontend/registry/explorer/components/details_page/delete_alert_spec.js
...try/explorer/components/details_page/delete_alert_spec.js
+1
-1
spec/frontend/registry/explorer/components/details_page/delete_modal_spec.js
...try/explorer/components/details_page/delete_modal_spec.js
+1
-1
spec/frontend/registry/explorer/components/details_page/tags_list_spec.js
...gistry/explorer/components/details_page/tags_list_spec.js
+1
-1
spec/frontend/registry/explorer/components/list_page/image_list_row_spec.js
...stry/explorer/components/list_page/image_list_row_spec.js
+1
-1
spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js
.../registry/explorer/components/registry_breadcrumb_spec.js
+1
-1
spec/frontend/registry/explorer/mock_data.js
spec/frontend/registry/explorer/mock_data.js
+1
-1
spec/frontend/registry/explorer/pages/details_spec.js
spec/frontend/registry/explorer/pages/details_spec.js
+3
-3
spec/frontend/registry/explorer/pages/list_spec.js
spec/frontend/registry/explorer/pages/list_spec.js
+2
-2
spec/frontend/registry/settings/components/expiration_dropdown_spec.js
.../registry/settings/components/expiration_dropdown_spec.js
+1
-1
spec/frontend/registry/settings/components/expiration_input_spec.js
...end/registry/settings/components/expiration_input_spec.js
+1
-1
spec/frontend/registry/settings/components/expiration_run_text_spec.js
.../registry/settings/components/expiration_run_text_spec.js
+1
-1
spec/frontend/registry/settings/components/expiration_toggle_spec.js
...nd/registry/settings/components/expiration_toggle_spec.js
+1
-1
spec/frontend/registry/settings/components/registry_settings_app_spec.js
...egistry/settings/components/registry_settings_app_spec.js
+1
-1
spec/frontend/registry/settings/components/settings_form_spec.js
...ontend/registry/settings/components/settings_form_spec.js
+1
-1
spec/frontend/registry/settings/mock_data.js
spec/frontend/registry/settings/mock_data.js
+1
-1
spec/frontend/related_merge_requests/components/related_merge_requests_spec.js
..._merge_requests/components/related_merge_requests_spec.js
+1
-1
spec/frontend/related_merge_requests/store/actions_spec.js
spec/frontend/related_merge_requests/store/actions_spec.js
+6
-6
spec/frontend/releases/components/app_edit_new_spec.js
spec/frontend/releases/components/app_edit_new_spec.js
+3
-3
spec/frontend/releases/components/app_index_spec.js
spec/frontend/releases/components/app_index_spec.js
+2
-2
spec/frontend/releases/components/app_show_spec.js
spec/frontend/releases/components/app_show_spec.js
+1
-1
spec/frontend/releases/components/asset_links_form_spec.js
spec/frontend/releases/components/asset_links_form_spec.js
+3
-3
spec/frontend/releases/components/issuable_stats_spec.js
spec/frontend/releases/components/issuable_stats_spec.js
+1
-1
spec/frontend/releases/components/release_block_assets_spec.js
...frontend/releases/components/release_block_assets_spec.js
+7
-7
spec/frontend/releases/components/release_block_milestone_info_spec.js
.../releases/components/release_block_milestone_info_spec.js
+6
-6
spec/frontend/releases/components/releases_pagination_graphql_spec.js
...d/releases/components/releases_pagination_graphql_spec.js
+1
-1
spec/frontend/releases/components/releases_pagination_rest_spec.js
...tend/releases/components/releases_pagination_rest_spec.js
+1
-1
spec/frontend/releases/components/releases_pagination_spec.js
.../frontend/releases/components/releases_pagination_spec.js
+1
-1
spec/frontend/releases/components/tag_field_new_spec.js
spec/frontend/releases/components/tag_field_new_spec.js
+1
-1
No files found.
spec/frontend/projects/experiment_new_project_creation/components/app_spec.js
View file @
94cfbb0c
...
...
@@ -7,7 +7,7 @@ import LegacyContainer from '~/projects/experiment_new_project_creation/componen
describe
(
'
Experimental new project creation app
'
,
()
=>
{
let
wrapper
;
const
createComponent
=
propsData
=>
{
const
createComponent
=
(
propsData
)
=>
{
wrapper
=
shallowMount
(
App
,
{
propsData
});
};
...
...
spec/frontend/projects/experiment_new_project_creation/components/legacy_container_spec.js
View file @
94cfbb0c
...
...
@@ -6,7 +6,7 @@ describe('Legacy container component', () => {
let
wrapper
;
let
dummy
;
const
createComponent
=
propsData
=>
{
const
createComponent
=
(
propsData
)
=>
{
wrapper
=
shallowMount
(
LegacyContainer
,
{
propsData
});
};
...
...
spec/frontend/projects/experiment_new_project_creation/components/welcome_spec.js
View file @
94cfbb0c
...
...
@@ -6,7 +6,7 @@ describe('Welcome page', () => {
let
wrapper
;
let
trackingSpy
;
const
createComponent
=
propsData
=>
{
const
createComponent
=
(
propsData
)
=>
{
wrapper
=
shallowMount
(
WelcomePage
,
{
propsData
});
};
...
...
spec/frontend/projects/project_import_gitlab_project_spec.js
View file @
94cfbb0c
...
...
@@ -4,7 +4,7 @@ describe('Import Gitlab project', () => {
const
pathName
=
'
my-project
'
;
const
projectName
=
'
My Project
'
;
const
setTestFixtures
=
url
=>
{
const
setTestFixtures
=
(
url
)
=>
{
window
.
history
.
pushState
({},
null
,
url
);
setFixtures
(
`
...
...
spec/frontend/projects/settings/access_dropdown_spec.js
View file @
94cfbb0c
...
...
@@ -72,7 +72,7 @@ describe('AccessDropdown', () => {
describe
(
'
with only role
'
,
()
=>
{
beforeEach
(()
=>
{
dropdown
.
setSelectedItems
(
dummyItems
.
filter
(
item
=>
item
.
type
===
LEVEL_TYPES
.
ROLE
));
dropdown
.
setSelectedItems
(
dummyItems
.
filter
(
(
item
)
=>
item
.
type
===
LEVEL_TYPES
.
ROLE
));
$dropdownToggleText
.
addClass
(
'
is-default
'
);
});
...
...
@@ -86,7 +86,7 @@ describe('AccessDropdown', () => {
describe
(
'
with only users
'
,
()
=>
{
beforeEach
(()
=>
{
dropdown
.
setSelectedItems
(
dummyItems
.
filter
(
item
=>
item
.
type
===
LEVEL_TYPES
.
USER
));
dropdown
.
setSelectedItems
(
dummyItems
.
filter
(
(
item
)
=>
item
.
type
===
LEVEL_TYPES
.
USER
));
$dropdownToggleText
.
addClass
(
'
is-default
'
);
});
...
...
@@ -100,7 +100,7 @@ describe('AccessDropdown', () => {
describe
(
'
with only groups
'
,
()
=>
{
beforeEach
(()
=>
{
dropdown
.
setSelectedItems
(
dummyItems
.
filter
(
item
=>
item
.
type
===
LEVEL_TYPES
.
GROUP
));
dropdown
.
setSelectedItems
(
dummyItems
.
filter
(
(
item
)
=>
item
.
type
===
LEVEL_TYPES
.
GROUP
));
$dropdownToggleText
.
addClass
(
'
is-default
'
);
});
...
...
@@ -115,7 +115,7 @@ describe('AccessDropdown', () => {
describe
(
'
with users and groups
'
,
()
=>
{
beforeEach
(()
=>
{
const
selectedTypes
=
[
LEVEL_TYPES
.
GROUP
,
LEVEL_TYPES
.
USER
];
dropdown
.
setSelectedItems
(
dummyItems
.
filter
(
item
=>
selectedTypes
.
includes
(
item
.
type
)));
dropdown
.
setSelectedItems
(
dummyItems
.
filter
(
(
item
)
=>
selectedTypes
.
includes
(
item
.
type
)));
$dropdownToggleText
.
addClass
(
'
is-default
'
);
});
...
...
@@ -130,7 +130,7 @@ describe('AccessDropdown', () => {
describe
(
'
with users and deploy keys
'
,
()
=>
{
beforeEach
(()
=>
{
const
selectedTypes
=
[
LEVEL_TYPES
.
DEPLOY_KEY
,
LEVEL_TYPES
.
USER
];
dropdown
.
setSelectedItems
(
dummyItems
.
filter
(
item
=>
selectedTypes
.
includes
(
item
.
type
)));
dropdown
.
setSelectedItems
(
dummyItems
.
filter
(
(
item
)
=>
selectedTypes
.
includes
(
item
.
type
)));
$dropdownToggleText
.
addClass
(
'
is-default
'
);
});
...
...
spec/frontend/projects/settings_service_desk/services/service_desk_service_spec.js
View file @
94cfbb0c
...
...
@@ -23,7 +23,7 @@ describe('ServiceDeskService', () => {
it
(
'
makes a request to set service desk
'
,
()
=>
{
axiosMock
.
onPut
(
endpoint
).
replyOnce
(
httpStatusCodes
.
OK
,
dummyResponse
);
return
service
.
toggleServiceDesk
(
true
).
then
(
response
=>
{
return
service
.
toggleServiceDesk
(
true
).
then
(
(
response
)
=>
{
expect
(
response
.
data
).
toEqual
(
dummyResponse
);
});
});
...
...
@@ -31,7 +31,7 @@ describe('ServiceDeskService', () => {
it
(
'
fails on error response
'
,
()
=>
{
axiosMock
.
onPut
(
endpoint
).
networkError
();
return
service
.
toggleServiceDesk
(
true
).
catch
(
error
=>
{
return
service
.
toggleServiceDesk
(
true
).
catch
(
(
error
)
=>
{
expect
(
error
.
message
).
toBe
(
errorMessage
);
});
});
...
...
@@ -63,7 +63,7 @@ describe('ServiceDeskService', () => {
},
true
,
)
.
then
(
response
=>
{
.
then
(
(
response
)
=>
{
expect
(
response
.
data
).
toEqual
(
dummyResponse
);
});
});
...
...
@@ -79,7 +79,7 @@ describe('ServiceDeskService', () => {
},
true
,
)
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
expect
(
error
.
message
).
toBe
(
errorMessage
);
});
});
...
...
spec/frontend/prometheus_metrics/prometheus_metrics_spec.js
View file @
94cfbb0c
...
...
@@ -133,7 +133,7 @@ describe('PrometheusMetrics', () => {
mock
.
restore
();
});
it
(
'
should show loader animation while response is being loaded and hide it when request is complete
'
,
done
=>
{
it
(
'
should show loader animation while response is being loaded and hide it when request is complete
'
,
(
done
)
=>
{
mockSuccess
();
prometheusMetrics
.
loadActiveMetrics
();
...
...
@@ -147,7 +147,7 @@ describe('PrometheusMetrics', () => {
});
});
it
(
'
should show empty state if response failed to load
'
,
done
=>
{
it
(
'
should show empty state if response failed to load
'
,
(
done
)
=>
{
mockError
();
prometheusMetrics
.
loadActiveMetrics
();
...
...
@@ -159,7 +159,7 @@ describe('PrometheusMetrics', () => {
});
});
it
(
'
should populate metrics list once response is loaded
'
,
done
=>
{
it
(
'
should populate metrics list once response is loaded
'
,
(
done
)
=>
{
jest
.
spyOn
(
prometheusMetrics
,
'
populateActiveMetrics
'
).
mockImplementation
();
mockSuccess
();
...
...
spec/frontend/ref/components/ref_selector_spec.js
View file @
94cfbb0c
...
...
@@ -37,7 +37,7 @@ describe('Ref selector component', () => {
attrs
,
listeners
:
{
// simulate a parent component v-model binding
input
:
selectedRef
=>
{
input
:
(
selectedRef
)
=>
{
wrapper
.
setProps
({
value
:
selectedRef
});
},
},
...
...
@@ -61,13 +61,13 @@ describe('Ref selector component', () => {
mock
.
onGet
(
`/api/v4/projects/
${
projectId
}
/repository/branches`
)
.
reply
(
config
=>
branchesApiCallSpy
(
config
));
.
reply
(
(
config
)
=>
branchesApiCallSpy
(
config
));
mock
.
onGet
(
`/api/v4/projects/
${
projectId
}
/repository/tags`
)
.
reply
(
config
=>
tagsApiCallSpy
(
config
));
.
reply
(
(
config
)
=>
tagsApiCallSpy
(
config
));
mock
.
onGet
(
new
RegExp
(
`/api/v4/projects/
${
projectId
}
/repository/commits/.*`
))
.
reply
(
config
=>
commitApiCallSpy
(
config
));
.
reply
(
(
config
)
=>
commitApiCallSpy
(
config
));
});
afterEach
(()
=>
{
...
...
@@ -122,7 +122,7 @@ describe('Ref selector component', () => {
//
// Convenience methods
//
const
updateQuery
=
newQuery
=>
{
const
updateQuery
=
(
newQuery
)
=>
{
findSearchBox
().
vm
.
$emit
(
'
input
'
,
newQuery
);
};
...
...
@@ -334,7 +334,7 @@ describe('Ref selector component', () => {
it
(
'
renders the default branch as a selectable item with a "default" badge
'
,
()
=>
{
const
dropdownItems
=
findBranchDropdownItems
();
const
defaultBranch
=
fixtures
.
branches
.
find
(
b
=>
b
.
default
);
const
defaultBranch
=
fixtures
.
branches
.
find
(
(
b
)
=>
b
.
default
);
const
defaultBranchIndex
=
fixtures
.
branches
.
indexOf
(
defaultBranch
);
expect
(
trimText
(
dropdownItems
.
at
(
defaultBranchIndex
).
text
())).
toBe
(
...
...
spec/frontend/registry/explorer/components/delete_button_spec.js
View file @
94cfbb0c
...
...
@@ -13,7 +13,7 @@ describe('delete_button', () => {
const
findButton
=
()
=>
wrapper
.
find
(
GlButton
);
const
mountComponent
=
props
=>
{
const
mountComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
component
,
{
propsData
:
{
...
defaultProps
,
...
...
spec/frontend/registry/explorer/components/details_page/delete_alert_spec.js
View file @
94cfbb0c
...
...
@@ -15,7 +15,7 @@ describe('Delete alert', () => {
const
findAlert
=
()
=>
wrapper
.
find
(
GlAlert
);
const
findLink
=
()
=>
wrapper
.
find
(
GlLink
);
const
mountComponent
=
propsData
=>
{
const
mountComponent
=
(
propsData
)
=>
{
wrapper
=
shallowMount
(
component
,
{
stubs
:
{
GlSprintf
},
propsData
});
};
...
...
spec/frontend/registry/explorer/components/details_page/delete_modal_spec.js
View file @
94cfbb0c
...
...
@@ -13,7 +13,7 @@ describe('Delete Modal', () => {
const
findModal
=
()
=>
wrapper
.
find
(
GlModal
);
const
findDescription
=
()
=>
wrapper
.
find
(
'
[data-testid="description"]
'
);
const
mountComponent
=
propsData
=>
{
const
mountComponent
=
(
propsData
)
=>
{
wrapper
=
shallowMount
(
component
,
{
propsData
,
stubs
:
{
...
...
spec/frontend/registry/explorer/components/details_page/tags_list_spec.js
View file @
94cfbb0c
...
...
@@ -8,7 +8,7 @@ import { tagsMock } from '../../mock_data';
describe
(
'
Tags List
'
,
()
=>
{
let
wrapper
;
const
tags
=
[...
tagsMock
];
const
readOnlyTags
=
tags
.
map
(
t
=>
({
...
t
,
canDelete
:
false
}));
const
readOnlyTags
=
tags
.
map
(
(
t
)
=>
({
...
t
,
canDelete
:
false
}));
const
findTagsListRow
=
()
=>
wrapper
.
findAll
(
TagsListRow
);
const
findDeleteButton
=
()
=>
wrapper
.
find
(
GlButton
);
...
...
spec/frontend/registry/explorer/components/list_page/image_list_row_spec.js
View file @
94cfbb0c
...
...
@@ -28,7 +28,7 @@ describe('Image List Row', () => {
const
findClipboardButton
=
()
=>
wrapper
.
find
(
ClipboardButton
);
const
findWarningIcon
=
()
=>
wrapper
.
find
(
'
[data-testid="warning-icon"]
'
);
const
mountComponent
=
props
=>
{
const
mountComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
Component
,
{
stubs
:
{
RouterLink
,
...
...
spec/frontend/registry/explorer/components/registry_breadcrumb_spec.js
View file @
94cfbb0c
...
...
@@ -37,7 +37,7 @@ describe('Registry Breadcrumb', () => {
const
findChildRoute
=
()
=>
wrapper
.
find
({
ref
:
'
childRouteLink
'
});
const
findLastCrumb
=
()
=>
wrapper
.
find
({
ref
:
'
lastCrumb
'
});
const
mountComponent
=
$route
=>
{
const
mountComponent
=
(
$route
)
=>
{
wrapper
=
shallowMount
(
component
,
{
propsData
:
{
crumbs
,
...
...
spec/frontend/registry/explorer/mock_data.js
View file @
94cfbb0c
...
...
@@ -158,7 +158,7 @@ export const tagsMock = [
},
];
export
const
graphQLImageDetailsMock
=
override
=>
({
export
const
graphQLImageDetailsMock
=
(
override
)
=>
({
data
:
{
containerRepository
:
{
...
containerRepositoryMock
,
...
...
spec/frontend/registry/explorer/pages/details_spec.js
View file @
94cfbb0c
...
...
@@ -46,7 +46,7 @@ describe('Details Page', () => {
updateName
:
jest
.
fn
(),
};
const
cleanTags
=
tagsMock
.
map
(
t
=>
{
const
cleanTags
=
tagsMock
.
map
(
(
t
)
=>
{
const
result
=
{
...
t
};
// eslint-disable-next-line no-underscore-dangle
delete
result
.
__typename
;
...
...
@@ -58,7 +58,7 @@ describe('Details Page', () => {
await
wrapper
.
vm
.
$nextTick
();
};
const
tagsArrayToSelectedTags
=
tags
=>
const
tagsArrayToSelectedTags
=
(
tags
)
=>
tags
.
reduce
((
acc
,
c
)
=>
{
acc
[
c
.
name
]
=
true
;
return
acc
;
...
...
@@ -334,7 +334,7 @@ describe('Details Page', () => {
findDeleteModal
().
vm
.
$emit
(
'
confirmDelete
'
);
expect
(
mutationResolver
).
toHaveBeenCalledWith
(
expect
.
objectContaining
({
tagNames
:
tagsMock
.
map
(
t
=>
t
.
name
)
}),
expect
.
objectContaining
({
tagNames
:
tagsMock
.
map
(
(
t
)
=>
t
.
name
)
}),
);
});
});
...
...
spec/frontend/registry/explorer/pages/list_spec.js
View file @
94cfbb0c
...
...
@@ -281,7 +281,7 @@ describe('List Page', () => {
const
updatedImage
=
findImageList
()
.
props
(
'
images
'
)
.
find
(
i
=>
i
.
id
===
deletedContainerRepository
.
id
);
.
find
(
(
i
)
=>
i
.
id
===
deletedContainerRepository
.
id
);
expect
(
updatedImage
.
status
).
toBe
(
deletedContainerRepository
.
status
);
});
...
...
@@ -418,7 +418,7 @@ describe('List Page', () => {
mountComponent
();
});
const
testTrackingCall
=
action
=>
{
const
testTrackingCall
=
(
action
)
=>
{
expect
(
Tracking
.
event
).
toHaveBeenCalledWith
(
undefined
,
action
,
{
label
:
'
registry_repository_delete
'
,
});
...
...
spec/frontend/registry/settings/components/expiration_dropdown_spec.js
View file @
94cfbb0c
...
...
@@ -18,7 +18,7 @@ describe('ExpirationDropdown', () => {
const
findFormGroup
=
()
=>
wrapper
.
find
(
GlFormGroup
);
const
findOptions
=
()
=>
wrapper
.
findAll
(
'
[data-testid="option"]
'
);
const
mountComponent
=
props
=>
{
const
mountComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
component
,
{
stubs
:
{
GlFormGroup
,
...
...
spec/frontend/registry/settings/components/expiration_input_spec.js
View file @
94cfbb0c
...
...
@@ -22,7 +22,7 @@ describe('ExpirationInput', () => {
const
findDescription
=
()
=>
wrapper
.
find
(
'
[data-testid="description"]
'
);
const
findDescriptionLink
=
()
=>
wrapper
.
find
(
GlLink
);
const
mountComponent
=
props
=>
{
const
mountComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
component
,
{
stubs
:
{
GlSprintf
,
...
...
spec/frontend/registry/settings/components/expiration_run_text_spec.js
View file @
94cfbb0c
...
...
@@ -11,7 +11,7 @@ describe('ExpirationToggle', () => {
const
findInput
=
()
=>
wrapper
.
find
(
GlFormInput
);
const
findFormGroup
=
()
=>
wrapper
.
find
(
GlFormGroup
);
const
mountComponent
=
propsData
=>
{
const
mountComponent
=
(
propsData
)
=>
{
wrapper
=
shallowMount
(
component
,
{
stubs
:
{
GlFormGroup
,
...
...
spec/frontend/registry/settings/components/expiration_toggle_spec.js
View file @
94cfbb0c
...
...
@@ -13,7 +13,7 @@ describe('ExpirationToggle', () => {
const
findToggle
=
()
=>
wrapper
.
find
(
GlToggle
);
const
findDescription
=
()
=>
wrapper
.
find
(
'
[data-testid="description"]
'
);
const
mountComponent
=
propsData
=>
{
const
mountComponent
=
(
propsData
)
=>
{
wrapper
=
shallowMount
(
component
,
{
stubs
:
{
GlFormGroup
,
...
...
spec/frontend/registry/settings/components/registry_settings_app_spec.js
View file @
94cfbb0c
...
...
@@ -59,7 +59,7 @@ describe('Registry Settings App', () => {
apolloProvider
:
fakeApollo
,
});
return
requestHandlers
.
map
(
request
=>
request
[
1
]);
return
requestHandlers
.
map
(
(
request
)
=>
request
[
1
]);
};
afterEach
(()
=>
{
...
...
spec/frontend/registry/settings/components/settings_form_spec.js
View file @
94cfbb0c
...
...
@@ -103,7 +103,7 @@ describe('Settings Form', () => {
},
});
return
requestHandlers
.
map
(
resolvers
=>
resolvers
[
1
]);
return
requestHandlers
.
map
(
(
resolvers
)
=>
resolvers
[
1
]);
};
beforeEach
(()
=>
{
...
...
spec/frontend/registry/settings/mock_data.js
View file @
94cfbb0c
...
...
@@ -8,7 +8,7 @@ export const containerExpirationPolicyData = () => ({
nextRunAt
:
'
2020-11-19T07:37:03.941Z
'
,
});
export
const
expirationPolicyPayload
=
override
=>
({
export
const
expirationPolicyPayload
=
(
override
)
=>
({
data
:
{
project
:
{
containerExpirationPolicy
:
{
...
...
spec/frontend/related_merge_requests/components/related_merge_requests_spec.js
View file @
94cfbb0c
...
...
@@ -14,7 +14,7 @@ describe('RelatedMergeRequests', () => {
let
mock
;
let
mockData
;
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
loadFixtures
(
FIXTURE_PATH
);
mockData
=
getJSONFixture
(
FIXTURE_PATH
);
...
...
spec/frontend/related_merge_requests/store/actions_spec.js
View file @
94cfbb0c
...
...
@@ -23,7 +23,7 @@ describe('RelatedMergeRequest store actions', () => {
});
describe
(
'
setInitialState
'
,
()
=>
{
it
(
'
commits types.SET_INITIAL_STATE with given props
'
,
done
=>
{
it
(
'
commits types.SET_INITIAL_STATE with given props
'
,
(
done
)
=>
{
const
props
=
{
a
:
1
,
b
:
2
};
testAction
(
...
...
@@ -38,13 +38,13 @@ describe('RelatedMergeRequest store actions', () => {
});
describe
(
'
requestData
'
,
()
=>
{
it
(
'
commits types.REQUEST_DATA
'
,
done
=>
{
it
(
'
commits types.REQUEST_DATA
'
,
(
done
)
=>
{
testAction
(
actions
.
requestData
,
null
,
{},
[{
type
:
types
.
REQUEST_DATA
}],
[],
done
);
});
});
describe
(
'
receiveDataSuccess
'
,
()
=>
{
it
(
'
commits types.RECEIVE_DATA_SUCCESS with data
'
,
done
=>
{
it
(
'
commits types.RECEIVE_DATA_SUCCESS with data
'
,
(
done
)
=>
{
const
data
=
{
a
:
1
,
b
:
2
};
testAction
(
...
...
@@ -59,7 +59,7 @@ describe('RelatedMergeRequest store actions', () => {
});
describe
(
'
receiveDataError
'
,
()
=>
{
it
(
'
commits types.RECEIVE_DATA_ERROR
'
,
done
=>
{
it
(
'
commits types.RECEIVE_DATA_ERROR
'
,
(
done
)
=>
{
testAction
(
actions
.
receiveDataError
,
null
,
...
...
@@ -73,7 +73,7 @@ describe('RelatedMergeRequest store actions', () => {
describe
(
'
fetchMergeRequests
'
,
()
=>
{
describe
(
'
for a successful request
'
,
()
=>
{
it
(
'
should dispatch success action
'
,
done
=>
{
it
(
'
should dispatch success action
'
,
(
done
)
=>
{
const
data
=
{
a
:
1
};
mock
.
onGet
(
`
${
state
.
apiEndpoint
}
?per_page=100`
).
replyOnce
(
200
,
data
,
{
'
x-total
'
:
2
});
...
...
@@ -89,7 +89,7 @@ describe('RelatedMergeRequest store actions', () => {
});
describe
(
'
for a failing request
'
,
()
=>
{
it
(
'
should dispatch error action
'
,
done
=>
{
it
(
'
should dispatch error action
'
,
(
done
)
=>
{
mock
.
onGet
(
`
${
state
.
apiEndpoint
}
?per_page=100`
).
replyOnce
(
400
);
testAction
(
...
...
spec/frontend/releases/components/app_edit_new_spec.js
View file @
94cfbb0c
...
...
@@ -71,7 +71,7 @@ describe('Release edit/new component', () => {
await
wrapper
.
vm
.
$nextTick
();
wrapper
.
element
.
querySelectorAll
(
'
input
'
).
forEach
(
input
=>
jest
.
spyOn
(
input
,
'
focus
'
));
wrapper
.
element
.
querySelectorAll
(
'
input
'
).
forEach
(
(
input
)
=>
jest
.
spyOn
(
input
,
'
focus
'
));
};
beforeEach
(()
=>
{
...
...
@@ -104,7 +104,7 @@ describe('Release edit/new component', () => {
const
firstEnabledInput
=
wrapper
.
element
.
querySelector
(
'
input:enabled
'
);
const
allInputs
=
wrapper
.
element
.
querySelectorAll
(
'
input
'
);
allInputs
.
forEach
(
input
=>
{
allInputs
.
forEach
(
(
input
)
=>
{
const
expectedFocusCalls
=
input
===
firstEnabledInput
?
1
:
0
;
expect
(
input
.
focus
).
toHaveBeenCalledTimes
(
expectedFocusCalls
);
});
...
...
@@ -152,7 +152,7 @@ describe('Release edit/new component', () => {
beforeEach
(
async
()
=>
{
commonUtils
.
getParameterByName
=
jest
.
fn
()
.
mockImplementation
(
paramToGet
=>
({
[
BACK_URL_PARAM
]:
backUrl
}[
paramToGet
]));
.
mockImplementation
(
(
paramToGet
)
=>
({
[
BACK_URL_PARAM
]:
backUrl
}[
paramToGet
]));
await
factory
();
});
...
...
spec/frontend/releases/components/app_index_spec.js
View file @
94cfbb0c
...
...
@@ -13,7 +13,7 @@ import ReleasesPagination from '~/releases/components/releases_pagination.vue';
jest
.
mock
(
'
~/lib/utils/common_utils
'
,
()
=>
({
...
jest
.
requireActual
(
'
~/lib/utils/common_utils
'
),
getParameterByName
:
jest
.
fn
().
mockImplementation
(
paramName
=>
{
getParameterByName
:
jest
.
fn
().
mockImplementation
(
(
paramName
)
=>
{
return
`
${
paramName
}
_param_value`
;
}),
}));
...
...
@@ -28,7 +28,7 @@ describe('Releases App ', () => {
let
wrapper
;
let
fetchReleaseSpy
;
const
paginatedReleases
=
rge
(
21
).
map
(
index
=>
({
const
paginatedReleases
=
rge
(
21
).
map
(
(
index
)
=>
({
...
convertObjectPropsToCamelCase
(
release
,
{
deep
:
true
}),
tagName
:
`
${
index
}
.00`
,
}));
...
...
spec/frontend/releases/components/app_show_spec.js
View file @
94cfbb0c
...
...
@@ -17,7 +17,7 @@ describe('Release show component', () => {
release
=
convertObjectPropsToCamelCase
(
originalRelease
);
});
const
factory
=
state
=>
{
const
factory
=
(
state
)
=>
{
actions
=
{
fetchRelease
:
jest
.
fn
(),
};
...
...
spec/frontend/releases/components/asset_links_form_spec.js
View file @
94cfbb0c
...
...
@@ -30,7 +30,7 @@ describe('Release edit component', () => {
updateAssetLinkName
:
jest
.
fn
(),
updateAssetLinkType
:
jest
.
fn
(),
removeAssetLink
:
jest
.
fn
().
mockImplementation
((
_context
,
linkId
)
=>
{
state
.
release
.
assets
.
links
=
state
.
release
.
assets
.
links
.
filter
(
l
=>
l
.
id
!==
linkId
);
state
.
release
.
assets
.
links
=
state
.
release
.
assets
.
links
.
filter
(
(
l
)
=>
l
.
id
!==
linkId
);
}),
};
...
...
@@ -104,7 +104,7 @@ describe('Release edit component', () => {
expect
(
actions
.
updateAssetLinkUrl
).
not
.
toHaveBeenCalled
();
};
const
dispatchKeydowEvent
=
eventParams
=>
{
const
dispatchKeydowEvent
=
(
eventParams
)
=>
{
const
event
=
new
KeyboardEvent
(
'
keydown
'
,
eventParams
);
input
.
dispatchEvent
(
event
);
...
...
@@ -162,7 +162,7 @@ describe('Release edit component', () => {
expect
(
actions
.
updateAssetLinkUrl
).
not
.
toHaveBeenCalled
();
};
const
dispatchKeydowEvent
=
eventParams
=>
{
const
dispatchKeydowEvent
=
(
eventParams
)
=>
{
const
event
=
new
KeyboardEvent
(
'
keydown
'
,
eventParams
);
input
.
dispatchEvent
(
event
);
...
...
spec/frontend/releases/components/issuable_stats_spec.js
View file @
94cfbb0c
...
...
@@ -7,7 +7,7 @@ describe('~/releases/components/issuable_stats.vue', () => {
let
wrapper
;
let
defaultProps
;
const
createComponent
=
propUpdates
=>
{
const
createComponent
=
(
propUpdates
)
=>
{
wrapper
=
mount
(
IssuableStats
,
{
propsData
:
{
...
defaultProps
,
...
...
spec/frontend/releases/components/release_block_assets_spec.js
View file @
94cfbb0c
...
...
@@ -26,8 +26,8 @@ describe('Release block assets', () => {
});
};
const
findSectionHeading
=
type
=>
wrapper
.
findAll
(
'
h5
'
).
filter
(
h5
=>
h5
.
text
()
===
sections
[
type
]);
const
findSectionHeading
=
(
type
)
=>
wrapper
.
findAll
(
'
h5
'
).
filter
(
(
h5
)
=>
h5
.
text
()
===
sections
[
type
]);
beforeEach
(()
=>
{
defaultProps
=
{
assets
:
convertObjectPropsToCamelCase
(
assets
,
{
deep
:
true
})
};
...
...
@@ -53,7 +53,7 @@ describe('Release block assets', () => {
});
it
(
'
renders sources with the expected text and URL
'
,
()
=>
{
defaultProps
.
assets
.
sources
.
forEach
(
s
=>
{
defaultProps
.
assets
.
sources
.
forEach
(
(
s
)
=>
{
const
sourceLink
=
wrapper
.
find
(
`li>a[href="
${
s
.
url
}
"]`
);
expect
(
sourceLink
.
exists
()).
toBe
(
true
);
...
...
@@ -62,7 +62,7 @@ describe('Release block assets', () => {
});
it
(
'
renders a heading for each assets type (except sources)
'
,
()
=>
{
Object
.
keys
(
sections
).
forEach
(
type
=>
{
Object
.
keys
(
sections
).
forEach
(
(
type
)
=>
{
const
sectionHeadings
=
findSectionHeading
(
type
);
expect
(
sectionHeadings
).
toHaveLength
(
1
);
...
...
@@ -70,7 +70,7 @@ describe('Release block assets', () => {
});
it
(
'
renders asset links with the expected text and URL
'
,
()
=>
{
defaultProps
.
assets
.
links
.
forEach
(
l
=>
{
defaultProps
.
assets
.
links
.
forEach
(
(
l
)
=>
{
const
sourceLink
=
wrapper
.
find
(
`li>a[href="
${
l
.
directAssetUrl
}
"]`
);
expect
(
sourceLink
.
exists
()).
toBe
(
true
);
...
...
@@ -84,7 +84,7 @@ describe('Release block assets', () => {
beforeEach
(()
=>
{
defaultProps
.
assets
.
links
=
defaultProps
.
assets
.
links
.
filter
(
l
=>
l
.
linkType
!==
typeToExclude
,
(
l
)
=>
l
.
linkType
!==
typeToExclude
,
);
createComponent
(
defaultProps
);
});
...
...
@@ -98,7 +98,7 @@ describe('Release block assets', () => {
describe
(
'
sources
'
,
()
=>
{
const
testSources
=
({
shouldSourcesBeRendered
})
=>
{
assets
.
sources
.
forEach
(
s
=>
{
assets
.
sources
.
forEach
(
(
s
)
=>
{
expect
(
wrapper
.
find
(
`a[href="
${
s
.
url
}
"]`
).
exists
()).
toBe
(
shouldSourcesBeRendered
);
});
};
...
...
spec/frontend/releases/components/release_block_milestone_info_spec.js
View file @
94cfbb0c
...
...
@@ -12,7 +12,7 @@ describe('Release block milestone info', () => {
let
wrapper
;
let
milestones
;
const
factory
=
props
=>
{
const
factory
=
(
props
)
=>
{
wrapper
=
mount
(
ReleaseBlockMilestoneInfo
,
{
propsData
:
props
,
});
...
...
@@ -106,10 +106,10 @@ describe('Release block milestone info', () => {
});
}
fullListString
=
lotsOfMilestones
.
map
(
m
=>
m
.
title
).
join
(
'
•
'
);
fullListString
=
lotsOfMilestones
.
map
(
(
m
)
=>
m
.
title
).
join
(
'
•
'
);
abbreviatedListString
=
lotsOfMilestones
.
slice
(
0
,
MAX_MILESTONES_TO_DISPLAY
)
.
map
(
m
=>
m
.
title
)
.
map
(
(
m
)
=>
m
.
title
)
.
join
(
'
•
'
);
return
factory
({
milestones
:
lotsOfMilestones
});
...
...
@@ -157,7 +157,7 @@ describe('Release block milestone info', () => {
/** Ensures we don't have any issues with dividing by zero when computing percentages */
describe
(
'
when all issue counts are zero
'
,
()
=>
{
beforeEach
(()
=>
{
milestones
=
milestones
.
map
(
m
=>
({
milestones
=
milestones
.
map
(
(
m
)
=>
({
...
m
,
issueStats
:
{
...
m
.
issueStats
,
...
...
@@ -174,7 +174,7 @@ describe('Release block milestone info', () => {
describe
(
'
if the API response is missing the "issue_stats" property
'
,
()
=>
{
beforeEach
(()
=>
{
milestones
=
milestones
.
map
(
m
=>
({
milestones
=
milestones
.
map
(
(
m
)
=>
({
...
m
,
issueStats
:
undefined
,
}));
...
...
@@ -195,7 +195,7 @@ describe('Release block milestone info', () => {
describe
(
'
if the API response includes the "mr_stats" property
'
,
()
=>
{
beforeEach
(()
=>
{
milestones
=
milestones
.
map
(
m
=>
({
milestones
=
milestones
.
map
(
(
m
)
=>
({
...
m
,
mrStats
:
{
total
:
15
,
...
...
spec/frontend/releases/components/releases_pagination_graphql_spec.js
View file @
94cfbb0c
...
...
@@ -24,7 +24,7 @@ describe('~/releases/components/releases_pagination_graphql.vue', () => {
const
projectPath
=
'
my/project
'
;
const
createComponent
=
pageInfo
=>
{
const
createComponent
=
(
pageInfo
)
=>
{
listModule
=
createListModule
({
projectPath
});
listModule
.
state
.
graphQlPageInfo
=
pageInfo
;
...
...
spec/frontend/releases/components/releases_pagination_rest_spec.js
View file @
94cfbb0c
...
...
@@ -17,7 +17,7 @@ describe('~/releases/components/releases_pagination_rest.vue', () => {
const
projectId
=
19
;
const
createComponent
=
pageInfo
=>
{
const
createComponent
=
(
pageInfo
)
=>
{
listModule
=
createListModule
({
projectId
});
listModule
.
state
.
restPageInfo
=
pageInfo
;
...
...
spec/frontend/releases/components/releases_pagination_spec.js
View file @
94cfbb0c
...
...
@@ -10,7 +10,7 @@ localVue.use(Vuex);
describe
(
'
~/releases/components/releases_pagination.vue
'
,
()
=>
{
let
wrapper
;
const
createComponent
=
useGraphQLEndpoint
=>
{
const
createComponent
=
(
useGraphQLEndpoint
)
=>
{
const
store
=
new
Vuex
.
Store
({
getters
:
{
useGraphQLEndpoint
:
()
=>
useGraphQLEndpoint
,
...
...
spec/frontend/releases/components/tag_field_new_spec.js
View file @
94cfbb0c
...
...
@@ -83,7 +83,7 @@ describe('releases/components/tag_field_new', () => {
* @param {'shown' | 'hidden'} state The expected state of the validation message.
* Should be passed either 'shown' or 'hidden'
*/
const
expectValidationMessageToBe
=
state
=>
{
const
expectValidationMessageToBe
=
(
state
)
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
findTagNameFormGroup
().
element
).
toHaveClass
(
state
===
'
shown
'
?
'
is-invalid
'
:
'
is-valid
'
,
...
...
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