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
86ce5406
Commit
86ce5406
authored
Dec 22, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 32 spec files: 5 of 10
Mandatory not to break master. Automatically created with prettier.
parent
da4eea76
Changes
33
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
108 additions
and
371 deletions
+108
-371
.prettierignore
.prettierignore
+0
-15
spec/frontend/alert_management/components/alert_management_table_spec.js
...lert_management/components/alert_management_table_spec.js
+18
-76
spec/frontend/alert_management/components/sidebar/alert_managment_sidebar_assignees_spec.js
...ponents/sidebar/alert_managment_sidebar_assignees_spec.js
+3
-15
spec/frontend/alerts_settings/alert_mapping_builder_spec.js
spec/frontend/alerts_settings/alert_mapping_builder_spec.js
+1
-5
spec/frontend/alerts_settings/alerts_integrations_list_spec.js
...frontend/alerts_settings/alerts_integrations_list_spec.js
+1
-5
spec/frontend/alerts_settings/alerts_settings_form_spec.js
spec/frontend/alerts_settings/alerts_settings_form_spec.js
+9
-33
spec/frontend/authentication/u2f/authenticate_spec.js
spec/frontend/authentication/u2f/authenticate_spec.js
+1
-4
spec/frontend/authentication/u2f/register_spec.js
spec/frontend/authentication/u2f/register_spec.js
+1
-4
spec/frontend/badges/components/badge_list_row_spec.js
spec/frontend/badges/components/badge_list_row_spec.js
+1
-3
spec/frontend/badges/components/badge_list_spec.js
spec/frontend/badges/components/badge_list_spec.js
+1
-3
spec/frontend/badges/store/actions_spec.js
spec/frontend/badges/store/actions_spec.js
+4
-1
spec/frontend/batch_comments/components/diff_file_drafts_spec.js
...ontend/batch_comments/components/diff_file_drafts_spec.js
+3
-13
spec/frontend/behaviors/requires_input_spec.js
spec/frontend/behaviors/requires_input_spec.js
+6
-18
spec/frontend/blob/components/blob_header_filepath_spec.js
spec/frontend/blob/components/blob_header_filepath_spec.js
+2
-12
spec/frontend/boards/components/board_assignee_dropdown_spec.js
...rontend/boards/components/board_assignee_dropdown_spec.js
+2
-7
spec/frontend/boards/components/board_card_spec.js
spec/frontend/boards/components/board_card_spec.js
+1
-3
spec/frontend/boards/components/issue_time_estimate_deprecated_spec.js
.../boards/components/issue_time_estimate_deprecated_spec.js
+3
-18
spec/frontend/boards/components/issue_time_estimate_spec.js
spec/frontend/boards/components/issue_time_estimate_spec.js
+3
-18
spec/frontend/boards/components/sidebar/board_sidebar_labels_select_spec.js
...ds/components/sidebar/board_sidebar_labels_select_spec.js
+4
-1
spec/frontend/boards/issue_card_deprecated_spec.js
spec/frontend/boards/issue_card_deprecated_spec.js
+2
-12
spec/frontend/boards/issue_card_inner_spec.js
spec/frontend/boards/issue_card_inner_spec.js
+2
-12
spec/frontend/boards/project_select_spec.js
spec/frontend/boards/project_select_spec.js
+5
-11
spec/frontend/boards/stores/actions_spec.js
spec/frontend/boards/stores/actions_spec.js
+2
-2
spec/frontend/boards/stores/getters_spec.js
spec/frontend/boards/stores/getters_spec.js
+2
-2
spec/frontend/boards/stores/mutations_spec.js
spec/frontend/boards/stores/mutations_spec.js
+10
-10
spec/frontend/ci_settings_pipeline_triggers/components/triggers_list_spec.js
...ttings_pipeline_triggers/components/triggers_list_spec.js
+2
-9
spec/frontend/ci_variable_list/ci_variable_list/ci_variable_list_spec.js
...i_variable_list/ci_variable_list/ci_variable_list_spec.js
+4
-17
spec/frontend/create_cluster/components/cluster_form_dropdown_spec.js
...d/create_cluster/components/cluster_form_dropdown_spec.js
+4
-16
spec/frontend/create_cluster/eks_cluster/services/aws_services_facade_spec.js
..._cluster/eks_cluster/services/aws_services_facade_spec.js
+4
-1
spec/frontend/deploy_freeze/components/deploy_freeze_modal_spec.js
...tend/deploy_freeze/components/deploy_freeze_modal_spec.js
+1
-4
spec/frontend/deploy_keys/components/app_spec.js
spec/frontend/deploy_keys/components/app_spec.js
+1
-6
spec/frontend/deploy_keys/components/key_spec.js
spec/frontend/deploy_keys/components/key_spec.js
+2
-9
spec/frontend/deploy_keys/components/keys_panel_spec.js
spec/frontend/deploy_keys/components/keys_panel_spec.js
+3
-6
No files found.
.prettierignore
View file @
86ce5406
...
...
@@ -11,21 +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/alert_management/components
spec/frontend/alerts_settings
spec/frontend/authentication/u2f
spec/frontend/badges/components
spec/frontend/badges/store
spec/frontend/batch_comments/components
spec/frontend/behaviors
spec/frontend/blob/components
spec/frontend/boards
spec/frontend/ci_settings_pipeline_triggers/components
spec/frontend/ci_variable_list/ci_variable_list
spec/frontend/create_cluster/components
spec/frontend/create_cluster/eks_cluster/services
spec/frontend/deploy_freeze/components
spec/frontend/deploy_keys/components
spec/frontend/design_management/components/design_notes
spec/frontend/design_management/pages
spec/frontend/diffs/components
...
...
spec/frontend/alert_management/components/alert_management_table_spec.js
View file @
86ce5406
...
...
@@ -85,11 +85,7 @@ describe('AlertManagementTable', () => {
});
expect
(
findAlertsTable
().
exists
()).
toBe
(
true
);
expect
(
findLoader
().
exists
()).
toBe
(
true
);
expect
(
findAlerts
()
.
at
(
0
)
.
classes
(),
).
not
.
toContain
(
'
gl-hover-bg-blue-50
'
);
expect
(
findAlerts
().
at
(
0
).
classes
()).
not
.
toContain
(
'
gl-hover-bg-blue-50
'
);
});
it
(
'
error state
'
,
()
=>
{
...
...
@@ -101,11 +97,7 @@ describe('AlertManagementTable', () => {
expect
(
findAlertsTable
().
text
()).
toContain
(
'
No alerts to display
'
);
expect
(
findLoader
().
exists
()).
toBe
(
false
);
expect
(
findAlert
().
props
().
variant
).
toBe
(
'
danger
'
);
expect
(
findAlerts
()
.
at
(
0
)
.
classes
(),
).
not
.
toContain
(
'
gl-hover-bg-blue-50
'
);
expect
(
findAlerts
().
at
(
0
).
classes
()).
not
.
toContain
(
'
gl-hover-bg-blue-50
'
);
});
it
(
'
empty state
'
,
()
=>
{
...
...
@@ -125,11 +117,7 @@ describe('AlertManagementTable', () => {
expect
(
findAlertsTable
().
text
()).
toContain
(
'
No alerts to display
'
);
expect
(
findLoader
().
exists
()).
toBe
(
false
);
expect
(
findAlert
().
props
().
variant
).
toBe
(
'
info
'
);
expect
(
findAlerts
()
.
at
(
0
)
.
classes
(),
).
not
.
toContain
(
'
gl-hover-bg-blue-50
'
);
expect
(
findAlerts
().
at
(
0
).
classes
()).
not
.
toContain
(
'
gl-hover-bg-blue-50
'
);
});
it
(
'
has data state
'
,
()
=>
{
...
...
@@ -140,11 +128,7 @@ describe('AlertManagementTable', () => {
expect
(
findLoader
().
exists
()).
toBe
(
false
);
expect
(
findAlertsTable
().
exists
()).
toBe
(
true
);
expect
(
findAlerts
()).
toHaveLength
(
mockAlerts
.
length
);
expect
(
findAlerts
()
.
at
(
0
)
.
classes
(),
).
toContain
(
'
gl-hover-bg-blue-50
'
);
expect
(
findAlerts
().
at
(
0
).
classes
()).
toContain
(
'
gl-hover-bg-blue-50
'
);
});
it
(
'
displays the alert ID and title formatted correctly
'
,
()
=>
{
...
...
@@ -170,11 +154,7 @@ describe('AlertManagementTable', () => {
data
:
{
alerts
:
{
list
:
mockAlerts
},
alertsCount
,
errored
:
false
},
loading
:
false
,
});
expect
(
findStatusDropdown
()
.
find
(
'
.dropdown-title
'
)
.
exists
(),
).
toBe
(
false
);
expect
(
findStatusDropdown
().
find
(
'
.dropdown-title
'
).
exists
()).
toBe
(
false
);
});
it
(
'
shows correct severity icons
'
,
async
()
=>
{
...
...
@@ -186,11 +166,7 @@ describe('AlertManagementTable', () => {
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
find
(
GlTable
).
exists
()).
toBe
(
true
);
expect
(
findAlertsTable
()
.
find
(
GlIcon
)
.
classes
(
'
icon-critical
'
),
).
toBe
(
true
);
expect
(
findAlertsTable
().
find
(
GlIcon
).
classes
(
'
icon-critical
'
)).
toBe
(
true
);
});
it
(
'
renders severity text
'
,
()
=>
{
...
...
@@ -199,11 +175,7 @@ describe('AlertManagementTable', () => {
loading
:
false
,
});
expect
(
findSeverityFields
()
.
at
(
0
)
.
text
(),
).
toBe
(
'
Critical
'
);
expect
(
findSeverityFields
().
at
(
0
).
text
()).
toBe
(
'
Critical
'
);
});
it
(
'
renders Unassigned when no assignee(s) present
'
,
()
=>
{
...
...
@@ -212,11 +184,7 @@ describe('AlertManagementTable', () => {
loading
:
false
,
});
expect
(
findAssignees
()
.
at
(
0
)
.
text
(),
).
toBe
(
'
Unassigned
'
);
expect
(
findAssignees
().
at
(
0
).
text
()).
toBe
(
'
Unassigned
'
);
});
it
(
'
renders user avatar when assignee present
'
,
()
=>
{
...
...
@@ -225,9 +193,7 @@ describe('AlertManagementTable', () => {
loading
:
false
,
});
const
avatar
=
findAssignees
()
.
at
(
1
)
.
find
(
GlAvatar
);
const
avatar
=
findAssignees
().
at
(
1
).
find
(
GlAvatar
);
const
{
src
,
label
}
=
avatar
.
attributes
();
const
{
name
,
avatarUrl
}
=
mockAlerts
[
1
].
assignees
.
nodes
[
0
];
...
...
@@ -244,9 +210,7 @@ describe('AlertManagementTable', () => {
expect
(
visitUrl
).
not
.
toHaveBeenCalled
();
findAlerts
()
.
at
(
0
)
.
trigger
(
'
click
'
);
findAlerts
().
at
(
0
).
trigger
(
'
click
'
);
expect
(
visitUrl
).
toHaveBeenCalledWith
(
'
/1527542/details
'
,
false
);
});
...
...
@@ -258,11 +222,9 @@ describe('AlertManagementTable', () => {
expect
(
visitUrl
).
not
.
toHaveBeenCalled
();
findAlerts
()
.
at
(
0
)
.
trigger
(
'
click
'
,
{
metaKey
:
true
,
});
findAlerts
().
at
(
0
).
trigger
(
'
click
'
,
{
metaKey
:
true
,
});
expect
(
visitUrl
).
toHaveBeenCalledWith
(
'
/1527542/details
'
,
true
);
});
...
...
@@ -276,24 +238,12 @@ describe('AlertManagementTable', () => {
});
it
(
'
shows "None" when no link exists
'
,
()
=>
{
expect
(
findIssueFields
()
.
at
(
0
)
.
text
(),
).
toBe
(
'
None
'
);
expect
(
findIssueFields
().
at
(
0
).
text
()).
toBe
(
'
None
'
);
});
it
(
'
renders a link when one exists
'
,
()
=>
{
expect
(
findIssueFields
()
.
at
(
1
)
.
text
(),
).
toBe
(
'
#1
'
);
expect
(
findIssueFields
()
.
at
(
1
)
.
attributes
(
'
href
'
),
).
toBe
(
'
/gitlab-org/gitlab/-/issues/1
'
);
expect
(
findIssueFields
().
at
(
1
).
text
()).
toBe
(
'
#1
'
);
expect
(
findIssueFields
().
at
(
1
).
attributes
(
'
href
'
)).
toBe
(
'
/gitlab-org/gitlab/-/issues/1
'
);
});
});
...
...
@@ -350,11 +300,7 @@ describe('AlertManagementTable', () => {
loading
:
false
,
});
expect
(
findAlerts
()
.
at
(
0
)
.
classes
(),
).
toContain
(
'
new-alert
'
);
expect
(
findAlerts
().
at
(
0
).
classes
()).
toContain
(
'
new-alert
'
);
});
it
(
'
should not highlight the row when alert is not new
'
,
()
=>
{
...
...
@@ -363,11 +309,7 @@ describe('AlertManagementTable', () => {
loading
:
false
,
});
expect
(
findAlerts
()
.
at
(
0
)
.
classes
(),
).
not
.
toContain
(
'
new-alert
'
);
expect
(
findAlerts
().
at
(
0
).
classes
()).
not
.
toContain
(
'
new-alert
'
);
});
});
});
...
...
spec/frontend/alert_management/components/sidebar/alert_managment_sidebar_assignees_spec.js
View file @
86ce5406
...
...
@@ -165,21 +165,9 @@ describe('Alert Details Sidebar Assignees', () => {
},
});
expect
(
findAssigned
()
.
find
(
'
img
'
)
.
attributes
(
'
src
'
),
).
toBe
(
'
/url
'
);
expect
(
findAssigned
()
.
find
(
'
.dropdown-menu-user-full-name
'
)
.
text
(),
).
toBe
(
'
root
'
);
expect
(
findAssigned
()
.
find
(
'
.dropdown-menu-user-username
'
)
.
text
(),
).
toBe
(
'
@root
'
);
expect
(
findAssigned
().
find
(
'
img
'
).
attributes
(
'
src
'
)).
toBe
(
'
/url
'
);
expect
(
findAssigned
().
find
(
'
.dropdown-menu-user-full-name
'
).
text
()).
toBe
(
'
root
'
);
expect
(
findAssigned
().
find
(
'
.dropdown-menu-user-username
'
).
text
()).
toBe
(
'
@root
'
);
});
});
});
spec/frontend/alerts_settings/alert_mapping_builder_spec.js
View file @
86ce5406
...
...
@@ -28,11 +28,7 @@ describe('AlertMappingBuilder', () => {
});
const
findColumnInRow
=
(
row
,
column
)
=>
wrapper
.
findAll
(
'
.gl-display-table-row
'
)
.
at
(
row
)
.
findAll
(
'
.gl-display-table-cell
'
)
.
at
(
column
);
wrapper
.
findAll
(
'
.gl-display-table-row
'
).
at
(
row
).
findAll
(
'
.gl-display-table-cell
'
).
at
(
column
);
it
(
'
renders column captions
'
,
()
=>
{
expect
(
findColumnInRow
(
0
,
0
).
text
()).
toContain
(
i18n
.
columns
.
gitlabKeyTitle
);
...
...
spec/frontend/alerts_settings/alerts_integrations_list_spec.js
View file @
86ce5406
...
...
@@ -72,11 +72,7 @@ describe('AlertIntegrationsList', () => {
it
(
'
renders an highlighted row when a current integration is selected to edit
'
,
()
=>
{
mountComponent
({
data
:
{
currentIntegration
:
{
id
:
'
1
'
}
}
});
expect
(
findTableComponentRows
()
.
at
(
0
)
.
classes
(),
).
toContain
(
'
gl-bg-blue-50
'
);
expect
(
findTableComponentRows
().
at
(
0
).
classes
()).
toContain
(
'
gl-bg-blue-50
'
);
});
describe
(
'
integration status
'
,
()
=>
{
...
...
spec/frontend/alerts_settings/alerts_settings_form_spec.js
View file @
86ce5406
...
...
@@ -86,11 +86,7 @@ describe('AlertsSettingsFormNew', () => {
await
wrapper
.
vm
.
$nextTick
();
expect
(
findFormFields
()
.
at
(
0
)
.
isVisible
(),
).
toBe
(
true
);
expect
(
findFormFields
().
at
(
0
).
isVisible
()).
toBe
(
true
);
});
it
(
'
disables the dropdown and shows help text when multi integrations are not supported
'
,
async
()
=>
{
...
...
@@ -104,11 +100,7 @@ describe('AlertsSettingsFormNew', () => {
const
options
=
findSelect
().
findAll
(
'
option
'
);
await
options
.
at
(
2
).
setSelected
();
expect
(
findFormFields
()
.
at
(
0
)
.
attributes
(
'
disabled
'
),
).
toBe
(
'
disabled
'
);
expect
(
findFormFields
().
at
(
0
).
attributes
(
'
disabled
'
)).
toBe
(
'
disabled
'
);
});
});
...
...
@@ -119,9 +111,7 @@ describe('AlertsSettingsFormNew', () => {
const
options
=
findSelect
().
findAll
(
'
option
'
);
await
options
.
at
(
1
).
setSelected
();
await
findFormFields
()
.
at
(
0
)
.
setValue
(
'
Test integration
'
);
await
findFormFields
().
at
(
0
).
setValue
(
'
Test integration
'
);
await
findFormToggle
().
trigger
(
'
click
'
);
await
wrapper
.
vm
.
$nextTick
();
...
...
@@ -145,12 +135,8 @@ describe('AlertsSettingsFormNew', () => {
const
options
=
findSelect
().
findAll
(
'
option
'
);
await
options
.
at
(
2
).
setSelected
();
await
findFormFields
()
.
at
(
0
)
.
setValue
(
'
Test integration
'
);
await
findFormFields
()
.
at
(
1
)
.
setValue
(
'
https://test.com
'
);
await
findFormFields
().
at
(
0
).
setValue
(
'
Test integration
'
);
await
findFormFields
().
at
(
1
).
setValue
(
'
https://test.com
'
);
await
findFormToggle
().
trigger
(
'
click
'
);
await
wrapper
.
vm
.
$nextTick
();
...
...
@@ -179,9 +165,7 @@ describe('AlertsSettingsFormNew', () => {
},
});
await
findFormFields
()
.
at
(
0
)
.
setValue
(
'
Test integration post
'
);
await
findFormFields
().
at
(
0
).
setValue
(
'
Test integration post
'
);
await
findFormToggle
().
trigger
(
'
click
'
);
await
wrapper
.
vm
.
$nextTick
();
...
...
@@ -210,12 +194,8 @@ describe('AlertsSettingsFormNew', () => {
},
});
await
findFormFields
()
.
at
(
0
)
.
setValue
(
'
Test integration
'
);
await
findFormFields
()
.
at
(
1
)
.
setValue
(
'
https://test-post.com
'
);
await
findFormFields
().
at
(
0
).
setValue
(
'
Test integration
'
);
await
findFormFields
().
at
(
1
).
setValue
(
'
https://test-post.com
'
);
await
findFormToggle
().
trigger
(
'
click
'
);
await
wrapper
.
vm
.
$nextTick
();
...
...
@@ -300,11 +280,7 @@ describe('AlertsSettingsFormNew', () => {
resetSamplePayloadConfirmed
,
});
await
wrapper
.
vm
.
$nextTick
();
expect
(
findTestPayloadSection
()
.
find
(
GlFormTextarea
)
.
attributes
(
'
disabled
'
),
).
toBe
(
disabled
);
expect
(
findTestPayloadSection
().
find
(
GlFormTextarea
).
attributes
(
'
disabled
'
)).
toBe
(
disabled
);
});
});
...
...
spec/frontend/authentication/u2f/authenticate_spec.js
View file @
86ce5406
...
...
@@ -55,10 +55,7 @@ describe('U2FAuthenticate', () => {
jest
.
spyOn
(
component
,
'
renderAuthenticated
'
).
mockReturnValue
(
true
);
u2fDevice
=
new
MockU2FDevice
();
component
.
start
()
.
then
(
done
)
.
catch
(
done
.
fail
);
component
.
start
().
then
(
done
).
catch
(
done
.
fail
);
});
it
(
'
allows authenticating via a U2F device
'
,
()
=>
{
...
...
spec/frontend/authentication/u2f/register_spec.js
View file @
86ce5406
...
...
@@ -15,10 +15,7 @@ describe('U2FRegister', () => {
u2fDevice
=
new
MockU2FDevice
();
container
=
$
(
'
#js-register-token-2fa
'
);
component
=
new
U2FRegister
(
container
,
{});
component
.
start
()
.
then
(
done
)
.
catch
(
done
.
fail
);
component
.
start
().
then
(
done
).
catch
(
done
.
fail
);
});
it
(
'
allows registering a U2F device
'
,
()
=>
{
...
...
spec/frontend/badges/components/badge_list_row_spec.js
View file @
86ce5406
...
...
@@ -91,9 +91,7 @@ describe('BadgeListRow component', () => {
beforeEach
(
done
=>
{
badge
.
kind
=
GROUP_BADGE
;
Vue
.
nextTick
()
.
then
(
done
)
.
catch
(
done
.
fail
);
Vue
.
nextTick
().
then
(
done
).
catch
(
done
.
fail
);
});
it
(
'
renders the badge kind
'
,
()
=>
{
...
...
spec/frontend/badges/components/badge_list_spec.js
View file @
86ce5406
...
...
@@ -76,9 +76,7 @@ describe('BadgeList component', () => {
beforeEach
(
done
=>
{
store
.
state
.
kind
=
GROUP_BADGE
;
Vue
.
nextTick
()
.
then
(
done
)
.
catch
(
done
.
fail
);
Vue
.
nextTick
().
then
(
done
).
catch
(
done
.
fail
);
});
it
(
'
renders a message if no badges exist
'
,
done
=>
{
...
...
spec/frontend/badges/store/actions_spec.js
View file @
86ce5406
...
...
@@ -9,7 +9,10 @@ import { createDummyBadge, createDummyBadgeResponse } from '../dummy_badge';
describe
(
'
Badges store actions
'
,
()
=>
{
const
dummyEndpointUrl
=
`
${
TEST_HOST
}
/badges/endpoint`
;
const
dummyBadges
=
[{
...
createDummyBadge
(),
id
:
5
},
{
...
createDummyBadge
(),
id
:
6
}];
const
dummyBadges
=
[
{
...
createDummyBadge
(),
id
:
5
},
{
...
createDummyBadge
(),
id
:
6
},
];
let
axiosMock
;
let
badgeId
;
...
...
spec/frontend/batch_comments/components/diff_file_drafts_spec.js
View file @
86ce5406
...
...
@@ -44,18 +44,8 @@ describe('Batch comments diff file drafts component', () => {
expect
(
vm
.
findAll
(
'
.js-diff-notes-index
'
).
length
).
toEqual
(
2
);
expect
(
vm
.
findAll
(
'
.js-diff-notes-index
'
)
.
at
(
0
)
.
text
(),
).
toEqual
(
'
1
'
);
expect
(
vm
.
findAll
(
'
.js-diff-notes-index
'
)
.
at
(
1
)
.
text
(),
).
toEqual
(
'
2
'
);
expect
(
vm
.
findAll
(
'
.js-diff-notes-index
'
).
at
(
0
).
text
()).
toEqual
(
'
1
'
);
expect
(
vm
.
findAll
(
'
.js-diff-notes-index
'
).
at
(
1
).
text
()).
toEqual
(
'
2
'
);
});
});
spec/frontend/behaviors/requires_input_spec.js
View file @
86ce5406
...
...
@@ -32,30 +32,18 @@ describe('requiresInput', () => {
it
(
'
enables submit when all required fields receive input
'
,
()
=>
{
$
(
'
.js-requires-input
'
).
requiresInput
();
$
(
'
#required1
'
)
.
val
(
'
input1
'
)
.
change
();
$
(
'
#required1
'
).
val
(
'
input1
'
).
change
();
expect
(
submitButton
).
toBeDisabled
();
$
(
'
#optional1
'
)
.
val
(
'
input1
'
)
.
change
();
$
(
'
#optional1
'
).
val
(
'
input1
'
).
change
();
expect
(
submitButton
).
toBeDisabled
();
$
(
'
#required2
'
)
.
val
(
'
input2
'
)
.
change
();
$
(
'
#required3
'
)
.
val
(
'
input3
'
)
.
change
();
$
(
'
#required4
'
)
.
val
(
'
input4
'
)
.
change
();
$
(
'
#required5
'
)
.
val
(
'
1
'
)
.
change
();
$
(
'
#required2
'
).
val
(
'
input2
'
).
change
();
$
(
'
#required3
'
).
val
(
'
input3
'
).
change
();
$
(
'
#required4
'
).
val
(
'
input4
'
).
change
();
$
(
'
#required5
'
).
val
(
'
1
'
).
change
();
expect
(
$
(
'
.submit
'
)).
not
.
toBeDisabled
();
});
...
...
spec/frontend/blob/components/blob_header_filepath_spec.js
View file @
86ce5406
...
...
@@ -32,12 +32,7 @@ describe('Blob Header Filepath', () => {
it
(
'
renders regular name
'
,
()
=>
{
createComponent
();
expect
(
wrapper
.
find
(
'
.js-blob-header-filepath
'
)
.
text
()
.
trim
(),
).
toBe
(
MockBlob
.
path
);
expect
(
wrapper
.
find
(
'
.js-blob-header-filepath
'
).
text
().
trim
()).
toBe
(
MockBlob
.
path
);
});
it
(
'
does not fail if the name is empty
'
,
()
=>
{
...
...
@@ -71,12 +66,7 @@ describe('Blob Header Filepath', () => {
);
expect
(
wrapper
.
text
()).
toContain
(
slotContent
);
expect
(
wrapper
.
text
()
.
trim
()
.
substring
(
0
,
slotContent
.
length
),
).
toBe
(
slotContent
);
expect
(
wrapper
.
text
().
trim
().
substring
(
0
,
slotContent
.
length
)).
toBe
(
slotContent
);
});
});
...
...
spec/frontend/boards/components/board_assignee_dropdown_spec.js
View file @
86ce5406
...
...
@@ -102,7 +102,7 @@ describe('BoardCardAssigneeDropdown', () => {
beforeEach
(()
=>
{
store
.
state
.
activeId
=
'
1
'
;
store
.
state
.
issues
=
{
'
1
'
:
{
1
:
{
iid
,
assignees
:
[{
username
:
activeIssueName
,
name
:
activeIssueName
,
id
:
activeIssueName
}],
},
...
...
@@ -145,12 +145,7 @@ describe('BoardCardAssigneeDropdown', () => {
it
(
'
renders gl-avatar-labeled in gl-avatar-link
'
,
()
=>
{
const
item
=
findByText
(
'
hello
'
);
expect
(
item
.
find
(
GlAvatarLink
)
.
find
(
GlAvatarLabeled
)
.
exists
(),
).
toBe
(
true
);
expect
(
item
.
find
(
GlAvatarLink
).
find
(
GlAvatarLabeled
).
exists
()).
toBe
(
true
);
});
});
...
...
spec/frontend/boards/components/board_card_spec.js
View file @
86ce5406
...
...
@@ -134,9 +134,7 @@ describe('BoardCard', () => {
it
(
'
does not set detail issue if link is clicked
'
,
()
=>
{
mountComponent
();
findIssueCardInner
()
.
find
(
'
a
'
)
.
trigger
(
'
mouseup
'
);
findIssueCardInner
().
find
(
'
a
'
).
trigger
(
'
mouseup
'
);
expect
(
boardsStore
.
detail
.
issue
).
toEqual
({});
});
...
...
spec/frontend/boards/components/issue_time_estimate_deprecated_spec.js
View file @
86ce5406
...
...
@@ -24,12 +24,7 @@ describe('Issue Time Estimate component', () => {
});
it
(
'
renders the correct time estimate
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
time
'
)
.
text
()
.
trim
(),
).
toEqual
(
'
2w 3d 1m
'
);
expect
(
wrapper
.
find
(
'
time
'
).
text
().
trim
()).
toEqual
(
'
2w 3d 1m
'
);
});
it
(
'
renders expanded time estimate in tooltip
'
,
()
=>
{
...
...
@@ -41,12 +36,7 @@ describe('Issue Time Estimate component', () => {
wrapper
.
setProps
({
estimate
:
'
Foo <script>alert("XSS")</script>
'
});
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
alertSpy
).
not
.
toHaveBeenCalled
();
expect
(
wrapper
.
find
(
'
time
'
)
.
text
()
.
trim
(),
).
toEqual
(
'
0m
'
);
expect
(
wrapper
.
find
(
'
time
'
).
text
().
trim
()).
toEqual
(
'
0m
'
);
expect
(
wrapper
.
find
(
'
.js-issue-time-estimate
'
).
text
()).
toContain
(
'
0m
'
);
done
();
});
...
...
@@ -64,12 +54,7 @@ describe('Issue Time Estimate component', () => {
});
it
(
'
renders the correct time estimate
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
time
'
)
.
text
()
.
trim
(),
).
toEqual
(
'
104h 1m
'
);
expect
(
wrapper
.
find
(
'
time
'
).
text
().
trim
()).
toEqual
(
'
104h 1m
'
);
});
it
(
'
renders expanded time estimate in tooltip
'
,
()
=>
{
...
...
spec/frontend/boards/components/issue_time_estimate_spec.js
View file @
86ce5406
...
...
@@ -21,12 +21,7 @@ describe('Issue Time Estimate component', () => {
});
it
(
'
renders the correct time estimate
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
time
'
)
.
text
()
.
trim
(),
).
toEqual
(
'
2w 3d 1m
'
);
expect
(
wrapper
.
find
(
'
time
'
).
text
().
trim
()).
toEqual
(
'
2w 3d 1m
'
);
});
it
(
'
renders expanded time estimate in tooltip
'
,
()
=>
{
...
...
@@ -38,12 +33,7 @@ describe('Issue Time Estimate component', () => {
wrapper
.
setProps
({
estimate
:
'
Foo <script>alert("XSS")</script>
'
});
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
alertSpy
).
not
.
toHaveBeenCalled
();
expect
(
wrapper
.
find
(
'
time
'
)
.
text
()
.
trim
(),
).
toEqual
(
'
0m
'
);
expect
(
wrapper
.
find
(
'
time
'
).
text
().
trim
()).
toEqual
(
'
0m
'
);
expect
(
wrapper
.
find
(
'
.js-issue-time-estimate
'
).
text
()).
toContain
(
'
0m
'
);
done
();
});
...
...
@@ -63,12 +53,7 @@ describe('Issue Time Estimate component', () => {
});
it
(
'
renders the correct time estimate
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
time
'
)
.
text
()
.
trim
(),
).
toEqual
(
'
104h 1m
'
);
expect
(
wrapper
.
find
(
'
time
'
).
text
().
trim
()).
toEqual
(
'
104h 1m
'
);
});
it
(
'
renders expanded time estimate in tooltip
'
,
()
=>
{
...
...
spec/frontend/boards/components/sidebar/board_sidebar_labels_select_spec.js
View file @
86ce5406
...
...
@@ -84,7 +84,10 @@ describe('~/boards/components/sidebar/board_sidebar_labels_select.vue', () => {
});
describe
(
'
when labels are updated over existing labels
'
,
()
=>
{
const
testLabelsPayload
=
[{
id
:
5
,
set
:
true
},
{
id
:
7
,
set
:
true
}];
const
testLabelsPayload
=
[
{
id
:
5
,
set
:
true
},
{
id
:
7
,
set
:
true
},
];
const
expectedLabels
=
[{
id
:
5
},
{
id
:
7
}];
beforeEach
(
async
()
=>
{
...
...
spec/frontend/boards/issue_card_deprecated_spec.js
View file @
86ce5406
...
...
@@ -245,12 +245,7 @@ describe('Issue card component', () => {
});
it
(
'
renders more avatar counter
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.board-card-assignee .avatar-counter
'
)
.
text
()
.
trim
(),
).
toEqual
(
'
+2
'
);
expect
(
wrapper
.
find
(
'
.board-card-assignee .avatar-counter
'
).
text
().
trim
()).
toEqual
(
'
+2
'
);
});
it
(
'
renders two assignees
'
,
()
=>
{
...
...
@@ -278,12 +273,7 @@ describe('Issue card component', () => {
});
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
find
(
'
.board-card-assignee .avatar-counter
'
)
.
text
()
.
trim
(),
).
toEqual
(
'
99+
'
);
expect
(
wrapper
.
find
(
'
.board-card-assignee .avatar-counter
'
).
text
().
trim
()).
toEqual
(
'
99+
'
);
done
();
});
});
...
...
spec/frontend/boards/issue_card_inner_spec.js
View file @
86ce5406
...
...
@@ -250,12 +250,7 @@ describe('Issue card component', () => {
});
it
(
'
renders more avatar counter
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.board-card-assignee .avatar-counter
'
)
.
text
()
.
trim
(),
).
toEqual
(
'
+2
'
);
expect
(
wrapper
.
find
(
'
.board-card-assignee .avatar-counter
'
).
text
().
trim
()).
toEqual
(
'
+2
'
);
});
it
(
'
renders two assignees
'
,
()
=>
{
...
...
@@ -281,12 +276,7 @@ describe('Issue card component', () => {
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
find
(
'
.board-card-assignee .avatar-counter
'
)
.
text
()
.
trim
(),
).
toEqual
(
'
99+
'
);
expect
(
wrapper
.
find
(
'
.board-card-assignee .avatar-counter
'
).
text
().
trim
()).
toEqual
(
'
99+
'
);
});
});
});
...
...
spec/frontend/boards/project_select_spec.js
View file @
86ce5406
...
...
@@ -39,9 +39,7 @@ describe('ProjectSelect component', () => {
const
findLabel
=
()
=>
wrapper
.
find
(
"
[data-testid='header-label']
"
);
const
findGlDropdown
=
()
=>
wrapper
.
find
(
GlDropdown
);
const
findGlDropdownLoadingIcon
=
()
=>
findGlDropdown
()
.
find
(
'
button:first-child
'
)
.
find
(
GlLoadingIcon
);
findGlDropdown
().
find
(
'
button:first-child
'
).
find
(
GlLoadingIcon
);
const
findGlSearchBoxByType
=
()
=>
wrapper
.
find
(
GlSearchBoxByType
);
const
findGlDropdownItems
=
()
=>
wrapper
.
findAll
(
GlDropdownItem
);
const
findFirstGlDropdownItem
=
()
=>
findGlDropdownItems
().
at
(
0
);
...
...
@@ -159,9 +157,7 @@ describe('ProjectSelect component', () => {
await
createWrapper
();
await
findFirstGlDropdownItem
()
.
find
(
'
button
'
)
.
trigger
(
'
click
'
);
await
findFirstGlDropdownItem
().
find
(
'
button
'
).
trigger
(
'
click
'
);
});
it
(
'
emits setSelectedProject with correct project metadata
'
,
()
=>
{
...
...
@@ -174,11 +170,9 @@ describe('ProjectSelect component', () => {
});
it
(
'
renders the name of the selected project
'
,
()
=>
{
expect
(
findGlDropdown
()
.
find
(
'
.gl-new-dropdown-button-text
'
)
.
text
(),
).
toBe
(
mockProjectsList1
[
0
].
name
);
expect
(
findGlDropdown
().
find
(
'
.gl-new-dropdown-button-text
'
).
text
()).
toBe
(
mockProjectsList1
[
0
].
name
,
);
});
});
...
...
spec/frontend/boards/stores/actions_spec.js
View file @
86ce5406
...
...
@@ -526,8 +526,8 @@ describe('moveIssue', () => {
};
const
issues
=
{
'
436
'
:
mockIssue
,
'
437
'
:
mockIssue2
,
436
:
mockIssue
,
437
:
mockIssue2
,
};
const
state
=
{
...
...
spec/frontend/boards/stores/getters_spec.js
View file @
86ce5406
...
...
@@ -39,7 +39,7 @@ describe('Boards - Getters', () => {
});
describe
(
'
getIssueById
'
,
()
=>
{
const
state
=
{
issues
:
{
'
1
'
:
'
issue
'
}
};
const
state
=
{
issues
:
{
1
:
'
issue
'
}
};
it
.
each
`
id | expected
...
...
@@ -56,7 +56,7 @@ describe('Boards - Getters', () => {
$
{
'
1
'
}
|
${
'
issue
'
}
${
''
}
|
${{}}
`('returns $expected when $id is passed to state', ({ id, expected }) => {
const state = { issues: {
'1'
: 'issue' }, activeId: id };
const state = { issues: {
1
: 'issue' }, activeId: id };
expect(getters.activeIssue(state)).toEqual(expected);
});
...
...
spec/frontend/boards/stores/mutations_spec.js
View file @
86ce5406
...
...
@@ -236,7 +236,7 @@ describe('Board Store Mutations', () => {
'
gid://gitlab/List/1
'
:
[
mockIssue
.
id
],
};
const
issues
=
{
'
1
'
:
mockIssue
,
1
:
mockIssue
,
};
state
=
{
...
...
@@ -345,8 +345,8 @@ describe('Board Store Mutations', () => {
};
const
issues
=
{
'
1
'
:
mockIssue
,
'
2
'
:
mockIssue2
,
1
:
mockIssue
,
2
:
mockIssue2
,
};
state
=
{
...
...
@@ -374,7 +374,7 @@ describe('Board Store Mutations', () => {
describe
(
'
MOVE_ISSUE_SUCCESS
'
,
()
=>
{
it
(
'
updates issue in issues state
'
,
()
=>
{
const
issues
=
{
'
436
'
:
{
id
:
rawIssue
.
id
},
436
:
{
id
:
rawIssue
.
id
},
};
state
=
{
...
...
@@ -386,7 +386,7 @@ describe('Board Store Mutations', () => {
issue
:
rawIssue
,
});
expect
(
state
.
issues
).
toEqual
({
'
436
'
:
{
...
mockIssue
,
id
:
436
}
});
expect
(
state
.
issues
).
toEqual
({
436
:
{
...
mockIssue
,
id
:
436
}
});
});
});
...
...
@@ -446,7 +446,7 @@ describe('Board Store Mutations', () => {
'
gid://gitlab/List/1
'
:
[
mockIssue
.
id
],
};
const
issues
=
{
'
1
'
:
mockIssue
,
1
:
mockIssue
,
};
state
=
{
...
...
@@ -472,8 +472,8 @@ describe('Board Store Mutations', () => {
'
gid://gitlab/List/1
'
:
[
mockIssue
.
id
,
mockIssue2
.
id
],
};
const
issues
=
{
'
1
'
:
mockIssue
,
'
2
'
:
mockIssue2
,
1
:
mockIssue
,
2
:
mockIssue2
,
};
state
=
{
...
...
@@ -496,8 +496,8 @@ describe('Board Store Mutations', () => {
'
gid://gitlab/List/1
'
:
[
mockIssue
.
id
,
mockIssue2
.
id
],
};
const
issues
=
{
'
1
'
:
mockIssue
,
'
2
'
:
mockIssue2
,
1
:
mockIssue
,
2
:
mockIssue2
,
};
state
=
{
...
...
spec/frontend/ci_settings_pipeline_triggers/components/triggers_list_spec.js
View file @
86ce5406
...
...
@@ -19,10 +19,7 @@ describe('TriggersList', () => {
const
findHeaderAt
=
i
=>
wrapper
.
findAll
(
'
thead th
'
).
at
(
i
);
const
findRows
=
()
=>
wrapper
.
findAll
(
'
tbody tr
'
);
const
findRowAt
=
i
=>
findRows
().
at
(
i
);
const
findCell
=
(
i
,
col
)
=>
findRowAt
(
i
)
.
findAll
(
'
td
'
)
.
at
(
col
);
const
findCell
=
(
i
,
col
)
=>
findRowAt
(
i
).
findAll
(
'
td
'
).
at
(
col
);
const
findClipboardBtn
=
i
=>
findCell
(
i
,
0
).
find
(
ClipboardButton
);
const
findInvalidBadge
=
i
=>
findCell
(
i
,
0
).
find
(
GlBadge
);
const
findEditBtn
=
i
=>
findRowAt
(
i
).
find
(
'
[data-testid="edit-btn"]
'
);
...
...
@@ -67,11 +64,7 @@ describe('TriggersList', () => {
it
(
'
displays a time ago label when last used
'
,
()
=>
{
expect
(
findCell
(
0
,
3
).
text
()).
toBe
(
'
Never
'
);
expect
(
findCell
(
1
,
3
)
.
find
(
TimeAgoTooltip
)
.
props
(
'
time
'
),
).
toBe
(
triggers
[
1
].
lastUsed
);
expect
(
findCell
(
1
,
3
).
find
(
TimeAgoTooltip
).
props
(
'
time
'
)).
toBe
(
triggers
[
1
].
lastUsed
);
});
it
(
'
displays actions in a rows
'
,
()
=>
{
...
...
spec/frontend/ci_variable_list/ci_variable_list/ci_variable_list_spec.js
View file @
86ce5406
...
...
@@ -31,10 +31,7 @@ describe('VariableList', () => {
it
(
'
should add another row when editing the last rows key input
'
,
()
=>
{
const
$row
=
$wrapper
.
find
(
'
.js-row
'
);
$row
.
find
(
'
.js-ci-variable-input-key
'
)
.
val
(
'
foo
'
)
.
trigger
(
'
input
'
);
$row
.
find
(
'
.js-ci-variable-input-key
'
).
val
(
'
foo
'
).
trigger
(
'
input
'
);
expect
(
$wrapper
.
find
(
'
.js-row
'
).
length
).
toBe
(
2
);
...
...
@@ -46,10 +43,7 @@ describe('VariableList', () => {
it
(
'
should add another row when editing the last rows value textarea
'
,
()
=>
{
const
$row
=
$wrapper
.
find
(
'
.js-row
'
);
$row
.
find
(
'
.js-ci-variable-input-value
'
)
.
val
(
'
foo
'
)
.
trigger
(
'
input
'
);
$row
.
find
(
'
.js-ci-variable-input-value
'
).
val
(
'
foo
'
).
trigger
(
'
input
'
);
expect
(
$wrapper
.
find
(
'
.js-row
'
).
length
).
toBe
(
2
);
...
...
@@ -61,18 +55,11 @@ describe('VariableList', () => {
it
(
'
should remove empty row after blurring
'
,
()
=>
{
const
$row
=
$wrapper
.
find
(
'
.js-row
'
);
$row
.
find
(
'
.js-ci-variable-input-key
'
)
.
val
(
'
foo
'
)
.
trigger
(
'
input
'
);
$row
.
find
(
'
.js-ci-variable-input-key
'
).
val
(
'
foo
'
).
trigger
(
'
input
'
);
expect
(
$wrapper
.
find
(
'
.js-row
'
).
length
).
toBe
(
2
);
$row
.
find
(
'
.js-ci-variable-input-key
'
)
.
val
(
''
)
.
trigger
(
'
input
'
)
.
trigger
(
'
blur
'
);
$row
.
find
(
'
.js-ci-variable-input-key
'
).
val
(
''
).
trigger
(
'
input
'
).
trigger
(
'
blur
'
);
expect
(
$wrapper
.
find
(
'
.js-row
'
).
length
).
toBe
(
1
);
});
...
...
spec/frontend/create_cluster/components/cluster_form_dropdown_spec.js
View file @
86ce5406
...
...
@@ -44,10 +44,7 @@ describe('ClusterFormDropdown', () => {
wrapper
.
setProps
({
items
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
wrapper
.
findAll
(
'
.js-dropdown-item
'
)
.
at
(
1
)
.
trigger
(
'
click
'
);
wrapper
.
findAll
(
'
.js-dropdown-item
'
).
at
(
1
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
();
});
});
...
...
@@ -65,17 +62,11 @@ describe('ClusterFormDropdown', () => {
return
wrapper
.
vm
.
$nextTick
()
.
then
(()
=>
{
wrapper
.
findAll
(
'
.js-dropdown-item
'
)
.
at
(
0
)
.
trigger
(
'
click
'
);
wrapper
.
findAll
(
'
.js-dropdown-item
'
).
at
(
0
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
();
})
.
then
(()
=>
{
wrapper
.
findAll
(
'
.js-dropdown-item
'
)
.
at
(
1
)
.
trigger
(
'
click
'
);
wrapper
.
findAll
(
'
.js-dropdown-item
'
).
at
(
1
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
();
});
});
...
...
@@ -102,10 +93,7 @@ describe('ClusterFormDropdown', () => {
wrapper
.
setProps
({
items
,
multiple
:
true
,
value
:
null
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
wrapper
.
findAll
(
'
.js-dropdown-item
'
)
.
at
(
0
)
.
trigger
(
'
click
'
);
wrapper
.
findAll
(
'
.js-dropdown-item
'
).
at
(
0
).
trigger
(
'
click
'
);
expect
(
wrapper
.
emitted
(
'
input
'
)[
0
]).
toEqual
([[
firstItem
.
value
]]);
});
...
...
spec/frontend/create_cluster/eks_cluster/services/aws_services_facade_spec.js
View file @
86ce5406
...
...
@@ -101,7 +101,10 @@ describe('awsServicesFacade', () => {
let
vpcsOutput
;
beforeEach
(()
=>
{
vpcs
=
[{
VpcId
:
'
vpc-1
'
,
Tags
:
[]
},
{
VpcId
:
'
vpc-2
'
,
Tags
:
[]
}];
vpcs
=
[
{
VpcId
:
'
vpc-1
'
,
Tags
:
[]
},
{
VpcId
:
'
vpc-2
'
,
Tags
:
[]
},
];
vpcsOutput
=
vpcs
.
map
(({
VpcId
:
vpcId
})
=>
({
name
:
vpcId
,
value
:
vpcId
}));
mockDescribeVpcsPromise
.
mockResolvedValueOnce
({
Vpcs
:
vpcs
});
...
...
spec/frontend/deploy_freeze/components/deploy_freeze_modal_spec.js
View file @
86ce5406
...
...
@@ -29,10 +29,7 @@ describe('Deploy freeze modal', () => {
});
const
findModal
=
()
=>
wrapper
.
find
(
GlModal
);
const
addDeployFreezeButton
=
()
=>
findModal
()
.
findAll
(
GlButton
)
.
at
(
1
);
const
addDeployFreezeButton
=
()
=>
findModal
().
findAll
(
GlButton
).
at
(
1
);
const
setInput
=
(
freezeStartCron
,
freezeEndCron
,
selectedTimezone
)
=>
{
store
.
state
.
freezeStartCron
=
freezeStartCron
;
...
...
spec/frontend/deploy_keys/components/app_spec.js
View file @
86ce5406
...
...
@@ -64,12 +64,7 @@ describe('Deploy keys app component', () => {
expect
(
element
.
exists
()).
toBe
(
true
);
expect
(
element
.
text
().
trim
()).
toContain
(
label
);
expect
(
element
.
find
(
'
.badge
'
)
.
text
()
.
trim
(),
).
toBe
(
count
.
toString
());
expect
(
element
.
find
(
'
.badge
'
).
text
().
trim
()).
toBe
(
count
.
toString
());
});
});
...
...
spec/frontend/deploy_keys/components/key_spec.js
View file @
86ce5406
...
...
@@ -9,11 +9,7 @@ describe('Deploy keys key', () => {
const
data
=
getJSONFixture
(
'
deploy_keys/keys.json
'
);
const
findTextAndTrim
=
selector
=>
wrapper
.
find
(
selector
)
.
text
()
.
trim
();
const
findTextAndTrim
=
selector
=>
wrapper
.
find
(
selector
).
text
().
trim
();
const
createComponent
=
propsData
=>
{
wrapper
=
mount
(
key
,
{
...
...
@@ -103,10 +99,7 @@ describe('Deploy keys key', () => {
it
(
'
expands all project labels after click
'
,
()
=>
{
createComponent
({
deployKey
});
const
{
length
}
=
deployKey
.
deploy_keys_projects
;
wrapper
.
findAll
(
'
.deploy-project-label
'
)
.
at
(
1
)
.
trigger
(
'
click
'
);
wrapper
.
findAll
(
'
.deploy-project-label
'
).
at
(
1
).
trigger
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
const
labels
=
wrapper
.
findAll
(
'
.deploy-project-label
'
);
...
...
spec/frontend/deploy_keys/components/keys_panel_spec.js
View file @
86ce5406
...
...
@@ -48,12 +48,9 @@ describe('Deploy keys panel', () => {
expect
(
wrapper
.
find
(
'
.settings-message
'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
.settings-message
'
)
.
text
()
.
trim
(),
).
toBe
(
'
No deploy keys found. Create one with the form above.
'
);
expect
(
wrapper
.
find
(
'
.settings-message
'
).
text
().
trim
()).
toBe
(
'
No deploy keys found. Create one with the form above.
'
,
);
});
it
(
'
renders no table header if keys are empty
'
,
()
=>
{
...
...
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