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
21fa9ca4
Commit
21fa9ca4
authored
Dec 22, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 32 spec files: 7 of 10
Mandatory not to break master. Automatically created with prettier.
parent
8b24c8d6
Changes
33
Show whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
224 additions
and
372 deletions
+224
-372
.prettierignore
.prettierignore
+0
-17
spec/frontend/incidents/components/incidents_list_spec.js
spec/frontend/incidents/components/incidents_list_spec.js
+3
-11
spec/frontend/incidents_settings/components/incidents_settings_tabs_spec.js
...dents_settings/components/incidents_settings_tabs_spec.js
+2
-9
spec/frontend/integrations/edit/components/dynamic_field_spec.js
...ontend/integrations/edit/components/dynamic_field_spec.js
+114
-137
spec/frontend/integrations/edit/components/jira_trigger_fields_spec.js
.../integrations/edit/components/jira_trigger_fields_spec.js
+1
-3
spec/frontend/issuable/related_issues/components/related_issues_block_spec.js
...le/related_issues/components/related_issues_block_spec.js
+1
-4
spec/frontend/issuable/related_issues/components/related_issues_list_spec.js
...ble/related_issues/components/related_issues_list_spec.js
+1
-6
spec/frontend/issuable/related_issues/components/related_issues_root_spec.js
...ble/related_issues/components/related_issues_root_spec.js
+1
-3
spec/frontend/issuable_list/components/issuable_item_spec.js
spec/frontend/issuable_list/components/issuable_item_spec.js
+3
-6
spec/frontend/issuable_show/components/issuable_body_spec.js
spec/frontend/issuable_show/components/issuable_body_spec.js
+1
-4
spec/frontend/issuable_suggestions/components/app_spec.js
spec/frontend/issuable_suggestions/components/app_spec.js
+2
-12
spec/frontend/issue_show/components/header_actions_spec.js
spec/frontend/issue_show/components/header_actions_spec.js
+1
-4
spec/frontend/issue_show/components/pinned_links_spec.js
spec/frontend/issue_show/components/pinned_links_spec.js
+2
-10
spec/frontend/issues_list/components/issuables_list_app_spec.js
...rontend/issues_list/components/issuables_list_app_spec.js
+5
-5
spec/frontend/jobs/components/empty_state_spec.js
spec/frontend/jobs/components/empty_state_spec.js
+2
-10
spec/frontend/jobs/components/job_app_spec.js
spec/frontend/jobs/components/job_app_spec.js
+4
-12
spec/frontend/jobs/components/log/line_spec.js
spec/frontend/jobs/components/log/line_spec.js
+1
-4
spec/frontend/jobs/components/log/log_spec.js
spec/frontend/jobs/components/log/log_spec.js
+1
-5
spec/frontend/lib/utils/chart_utils_spec.js
spec/frontend/lib/utils/chart_utils_spec.js
+5
-1
spec/frontend/logs/components/environment_logs_spec.js
spec/frontend/logs/components/environment_logs_spec.js
+1
-5
spec/frontend/members/components/action_buttons/resend_invite_button_spec.js
...rs/components/action_buttons/resend_invite_button_spec.js
+3
-5
spec/frontend/members/components/filter_sort/members_filtered_search_bar_spec.js
...omponents/filter_sort/members_filtered_search_bar_spec.js
+4
-1
spec/frontend/members/components/table/expiration_datepicker_spec.js
...nd/members/components/table/expiration_datepicker_spec.js
+3
-5
spec/frontend/members/components/table/members_table_spec.js
spec/frontend/members/components/table/members_table_spec.js
+6
-19
spec/frontend/milestones/milestone_combobox_spec.js
spec/frontend/milestones/milestone_combobox_spec.js
+8
-16
spec/frontend/monitoring/alert_widget_spec.js
spec/frontend/monitoring/alert_widget_spec.js
+12
-11
spec/frontend/monitoring/components/dashboard_panel_spec.js
spec/frontend/monitoring/components/dashboard_panel_spec.js
+1
-5
spec/frontend/monitoring/components/dashboard_spec.js
spec/frontend/monitoring/components/dashboard_spec.js
+6
-18
spec/frontend/monitoring/components/duplicate_dashboard_modal_spec.js
...d/monitoring/components/duplicate_dashboard_modal_spec.js
+1
-3
spec/frontend/monitoring/components/variables/dropdown_field_spec.js
...nd/monitoring/components/variables/dropdown_field_spec.js
+5
-4
spec/frontend/monitoring/router_spec.js
spec/frontend/monitoring/router_spec.js
+2
-12
spec/frontend/monitoring/store/mutations_spec.js
spec/frontend/monitoring/store/mutations_spec.js
+4
-1
spec/frontend/monitoring/store/utils_spec.js
spec/frontend/monitoring/store/utils_spec.js
+18
-4
No files found.
.prettierignore
View file @
21fa9ca4
...
@@ -11,23 +11,6 @@ doc/api/graphql/reference/gitlab_schema.graphql
...
@@ -11,23 +11,6 @@ doc/api/graphql/reference/gitlab_schema.graphql
*.md
*.md
# temporarly ignored in order to migrate to prettier@2 more efficiently and iteratively:
# temporarly ignored in order to migrate to prettier@2 more efficiently and iteratively:
spec/frontend/incidents/components
spec/frontend/incidents_settings/components
spec/frontend/integrations/edit/components
spec/frontend/issuable/related_issues/components
spec/frontend/issuable_list/components
spec/frontend/issuable_show/components
spec/frontend/issuable_suggestions/components
spec/frontend/issue_show/components
spec/frontend/issues_list/components
spec/frontend/jobs/components
spec/frontend/lib/utils
spec/frontend/logs/components
spec/frontend/members/components/action_buttons
spec/frontend/members/components/filter_sort
spec/frontend/members/components/table
spec/frontend/milestones
spec/frontend/monitoring
spec/frontend/notes
spec/frontend/notes
spec/frontend/packages/details/components
spec/frontend/packages/details/components
spec/frontend/packages/details/store
spec/frontend/packages/details/store
...
...
spec/frontend/incidents/components/incidents_list_spec.js
View file @
21fa9ca4
...
@@ -158,17 +158,11 @@ describe('Incidents List', () => {
...
@@ -158,17 +158,11 @@ describe('Incidents List', () => {
describe
(
'
Assignees
'
,
()
=>
{
describe
(
'
Assignees
'
,
()
=>
{
it
(
'
shows Unassigned when there are no assignees
'
,
()
=>
{
it
(
'
shows Unassigned when there are no assignees
'
,
()
=>
{
expect
(
expect
(
findAssignees
().
at
(
0
).
text
()).
toBe
(
I18N
.
unassigned
);
findAssignees
()
.
at
(
0
)
.
text
(),
).
toBe
(
I18N
.
unassigned
);
});
});
it
(
'
renders an avatar component when there is an assignee
'
,
()
=>
{
it
(
'
renders an avatar component when there is an assignee
'
,
()
=>
{
const
avatar
=
findAssignees
()
const
avatar
=
findAssignees
().
at
(
1
).
find
(
GlAvatar
);
.
at
(
1
)
.
find
(
GlAvatar
);
const
{
src
,
label
}
=
avatar
.
attributes
();
const
{
src
,
label
}
=
avatar
.
attributes
();
const
{
name
,
avatarUrl
}
=
mockIncidents
[
1
].
assignees
.
nodes
[
0
];
const
{
name
,
avatarUrl
}
=
mockIncidents
[
1
].
assignees
.
nodes
[
0
];
...
@@ -189,9 +183,7 @@ describe('Incidents List', () => {
...
@@ -189,9 +183,7 @@ describe('Incidents List', () => {
});
});
it
(
'
contains a link to the incident details page
'
,
async
()
=>
{
it
(
'
contains a link to the incident details page
'
,
async
()
=>
{
findTableRows
()
findTableRows
().
at
(
0
).
trigger
(
'
click
'
);
.
at
(
0
)
.
trigger
(
'
click
'
);
expect
(
visitUrl
).
toHaveBeenCalledWith
(
expect
(
visitUrl
).
toHaveBeenCalledWith
(
joinPaths
(
`/project/issues/incident`
,
mockIncidents
[
0
].
iid
),
joinPaths
(
`/project/issues/incident`
,
mockIncidents
[
0
].
iid
),
);
);
...
...
spec/frontend/incidents_settings/components/incidents_settings_tabs_spec.js
View file @
21fa9ca4
...
@@ -42,16 +42,9 @@ describe('IncidentsSettingTabs', () => {
...
@@ -42,16 +42,9 @@ describe('IncidentsSettingTabs', () => {
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
);
expect
(
findIntegrationTabs
().
length
).
toBe
(
activeTabs
.
length
);
activeTabs
.
forEach
((
tab
,
index
)
=>
{
activeTabs
.
forEach
((
tab
,
index
)
=>
{
expect
(
findIntegrationTabs
().
at
(
index
).
attributes
(
'
title
'
)).
toBe
(
tab
.
title
);
expect
(
expect
(
findIntegrationTabs
()
findIntegrationTabs
().
at
(
index
).
find
(
`[data-testid="
${
tab
.
component
}
-tab"]`
).
exists
(),
.
at
(
index
)
.
attributes
(
'
title
'
),
).
toBe
(
tab
.
title
);
expect
(
findIntegrationTabs
()
.
at
(
index
)
.
find
(
`[data-testid="
${
tab
.
component
}
-tab"]`
)
.
exists
(),
).
toBe
(
true
);
).
toBe
(
true
);
});
});
});
});
...
...
spec/frontend/integrations/edit/components/dynamic_field_spec.js
View file @
21fa9ca4
...
@@ -37,9 +37,10 @@ describe('DynamicField', () => {
...
@@ -37,9 +37,10 @@ describe('DynamicField', () => {
const
findGlFormTextarea
=
()
=>
wrapper
.
find
(
GlFormTextarea
);
const
findGlFormTextarea
=
()
=>
wrapper
.
find
(
GlFormTextarea
);
describe
(
'
template
'
,
()
=>
{
describe
(
'
template
'
,
()
=>
{
describe
.
each
([[
true
,
'
disabled
'
,
'
readonly
'
],
[
false
,
undefined
,
undefined
]])(
describe
.
each
([
'
dynamic field, when isInheriting = `%p`
'
,
[
true
,
'
disabled
'
,
'
readonly
'
],
(
isInheriting
,
disabled
,
readonly
)
=>
{
[
false
,
undefined
,
undefined
],
])(
'
dynamic field, when isInheriting = `%p`
'
,
(
isInheriting
,
disabled
,
readonly
)
=>
{
describe
(
'
type is checkbox
'
,
()
=>
{
describe
(
'
type is checkbox
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
createComponent
(
createComponent
(
...
@@ -52,11 +53,9 @@ describe('DynamicField', () => {
...
@@ -52,11 +53,9 @@ describe('DynamicField', () => {
it
(
`renders GlFormCheckbox, which
${
isInheriting
?
'
is
'
:
'
is not
'
}
disabled`
,
()
=>
{
it
(
`renders GlFormCheckbox, which
${
isInheriting
?
'
is
'
:
'
is not
'
}
disabled`
,
()
=>
{
expect
(
findGlFormCheckbox
().
exists
()).
toBe
(
true
);
expect
(
findGlFormCheckbox
().
exists
()).
toBe
(
true
);
expect
(
expect
(
findGlFormCheckbox
().
find
(
'
[type=checkbox]
'
).
attributes
(
'
disabled
'
)).
toBe
(
findGlFormCheckbox
()
disabled
,
.
find
(
'
[type=checkbox]
'
)
);
.
attributes
(
'
disabled
'
),
).
toBe
(
disabled
);
});
});
it
(
'
does not render other types of input
'
,
()
=>
{
it
(
'
does not render other types of input
'
,
()
=>
{
...
@@ -71,7 +70,10 @@ describe('DynamicField', () => {
...
@@ -71,7 +70,10 @@ describe('DynamicField', () => {
createComponent
(
createComponent
(
{
{
type
:
'
select
'
,
type
:
'
select
'
,
choices
:
[[
'
all
'
,
'
All details
'
],
[
'
standard
'
,
'
Standard
'
]],
choices
:
[
[
'
all
'
,
'
All details
'
],
[
'
standard
'
,
'
Standard
'
],
],
},
},
isInheriting
,
isInheriting
,
);
);
...
@@ -80,11 +82,7 @@ describe('DynamicField', () => {
...
@@ -80,11 +82,7 @@ describe('DynamicField', () => {
it
(
`renders GlFormSelect, which
${
isInheriting
?
'
is
'
:
'
is not
'
}
disabled`
,
()
=>
{
it
(
`renders GlFormSelect, which
${
isInheriting
?
'
is
'
:
'
is not
'
}
disabled`
,
()
=>
{
expect
(
findGlFormSelect
().
exists
()).
toBe
(
true
);
expect
(
findGlFormSelect
().
exists
()).
toBe
(
true
);
expect
(
findGlFormSelect
().
findAll
(
'
option
'
)).
toHaveLength
(
2
);
expect
(
findGlFormSelect
().
findAll
(
'
option
'
)).
toHaveLength
(
2
);
expect
(
expect
(
findGlFormSelect
().
find
(
'
select
'
).
attributes
(
'
disabled
'
)).
toBe
(
disabled
);
findGlFormSelect
()
.
find
(
'
select
'
)
.
attributes
(
'
disabled
'
),
).
toBe
(
disabled
);
});
});
it
(
'
does not render other types of input
'
,
()
=>
{
it
(
'
does not render other types of input
'
,
()
=>
{
...
@@ -106,11 +104,7 @@ describe('DynamicField', () => {
...
@@ -106,11 +104,7 @@ describe('DynamicField', () => {
it
(
`renders GlFormTextarea, which
${
isInheriting
?
'
is
'
:
'
is not
'
}
readonly`
,
()
=>
{
it
(
`renders GlFormTextarea, which
${
isInheriting
?
'
is
'
:
'
is not
'
}
readonly`
,
()
=>
{
expect
(
findGlFormTextarea
().
exists
()).
toBe
(
true
);
expect
(
findGlFormTextarea
().
exists
()).
toBe
(
true
);
expect
(
expect
(
findGlFormTextarea
().
find
(
'
textarea
'
).
attributes
(
'
readonly
'
)).
toBe
(
readonly
);
findGlFormTextarea
()
.
find
(
'
textarea
'
)
.
attributes
(
'
readonly
'
),
).
toBe
(
readonly
);
});
});
it
(
'
does not render other types of input
'
,
()
=>
{
it
(
'
does not render other types of input
'
,
()
=>
{
...
@@ -172,18 +166,13 @@ describe('DynamicField', () => {
...
@@ -172,18 +166,13 @@ describe('DynamicField', () => {
expect
(
findGlFormTextarea
().
exists
()).
toBe
(
false
);
expect
(
findGlFormTextarea
().
exists
()).
toBe
(
false
);
});
});
});
});
},
});
);
describe
(
'
help text
'
,
()
=>
{
describe
(
'
help text
'
,
()
=>
{
it
(
'
renders description with help text
'
,
()
=>
{
it
(
'
renders description with help text
'
,
()
=>
{
createComponent
();
createComponent
();
expect
(
expect
(
findGlFormGroup
().
find
(
'
small
'
).
text
()).
toBe
(
defaultProps
.
help
);
findGlFormGroup
()
.
find
(
'
small
'
)
.
text
(),
).
toBe
(
defaultProps
.
help
);
});
});
it
(
'
renders description with help text as HTML
'
,
()
=>
{
it
(
'
renders description with help text as HTML
'
,
()
=>
{
...
@@ -193,11 +182,7 @@ describe('DynamicField', () => {
...
@@ -193,11 +182,7 @@ describe('DynamicField', () => {
help
:
helpHTML
,
help
:
helpHTML
,
});
});
expect
(
expect
(
findGlFormGroup
().
find
(
'
small
'
).
html
()).
toContain
(
helpHTML
);
findGlFormGroup
()
.
find
(
'
small
'
)
.
html
(),
).
toContain
(
helpHTML
);
});
});
});
});
...
@@ -205,11 +190,7 @@ describe('DynamicField', () => {
...
@@ -205,11 +190,7 @@ describe('DynamicField', () => {
it
(
'
renders label with title
'
,
()
=>
{
it
(
'
renders label with title
'
,
()
=>
{
createComponent
();
createComponent
();
expect
(
expect
(
findGlFormGroup
().
find
(
'
label
'
).
text
()).
toBe
(
defaultProps
.
title
);
findGlFormGroup
()
.
find
(
'
label
'
)
.
text
(),
).
toBe
(
defaultProps
.
title
);
});
});
describe
(
'
for password field with some value (hidden by backend)
'
,
()
=>
{
describe
(
'
for password field with some value (hidden by backend)
'
,
()
=>
{
...
@@ -219,11 +200,7 @@ describe('DynamicField', () => {
...
@@ -219,11 +200,7 @@ describe('DynamicField', () => {
value
:
'
true
'
,
value
:
'
true
'
,
});
});
expect
(
expect
(
findGlFormGroup
().
find
(
'
label
'
).
text
()).
toBe
(
`Enter new
${
defaultProps
.
title
}
`
);
findGlFormGroup
()
.
find
(
'
label
'
)
.
text
(),
).
toBe
(
`Enter new
${
defaultProps
.
title
}
`
);
});
});
});
});
});
});
...
...
spec/frontend/integrations/edit/components/jira_trigger_fields_spec.js
View file @
21fa9ca4
...
@@ -57,9 +57,7 @@ describe('JiraTriggerFields', () => {
...
@@ -57,9 +57,7 @@ describe('JiraTriggerFields', () => {
// browsers don't include unchecked boxes in form submissions.
// browsers don't include unchecked boxes in form submissions.
it
(
'
includes comment settings as false even if unchecked
'
,
()
=>
{
it
(
'
includes comment settings as false even if unchecked
'
,
()
=>
{
expect
(
expect
(
findCommentSettings
()
findCommentSettings
().
find
(
'
input[name="service[comment_on_event_enabled]"]
'
).
exists
(),
.
find
(
'
input[name="service[comment_on_event_enabled]"]
'
)
.
exists
(),
).
toBe
(
true
);
).
toBe
(
true
);
});
});
...
...
spec/frontend/issuable/related_issues/components/related_issues_block_spec.js
View file @
21fa9ca4
...
@@ -130,10 +130,7 @@ describe('RelatedIssuesBlock', () => {
...
@@ -130,10 +130,7 @@ describe('RelatedIssuesBlock', () => {
describe
(
'
showCategorizedIssues prop
'
,
()
=>
{
describe
(
'
showCategorizedIssues prop
'
,
()
=>
{
const
issueList
=
()
=>
wrapper
.
findAll
(
'
.js-related-issues-token-list-item
'
);
const
issueList
=
()
=>
wrapper
.
findAll
(
'
.js-related-issues-token-list-item
'
);
const
categorizedHeadings
=
()
=>
wrapper
.
findAll
(
'
h4
'
);
const
categorizedHeadings
=
()
=>
wrapper
.
findAll
(
'
h4
'
);
const
headingTextAt
=
index
=>
const
headingTextAt
=
index
=>
categorizedHeadings
().
at
(
index
).
text
();
categorizedHeadings
()
.
at
(
index
)
.
text
();
const
mountComponent
=
showCategorizedIssues
=>
{
const
mountComponent
=
showCategorizedIssues
=>
{
wrapper
=
mount
(
RelatedIssuesBlock
,
{
wrapper
=
mount
(
RelatedIssuesBlock
,
{
propsData
:
{
propsData
:
{
...
...
spec/frontend/issuable/related_issues/components/related_issues_list_spec.js
View file @
21fa9ca4
...
@@ -182,12 +182,7 @@ describe('RelatedIssuesList', () => {
...
@@ -182,12 +182,7 @@ describe('RelatedIssuesList', () => {
});
});
it
(
'
shows due date
'
,
()
=>
{
it
(
'
shows due date
'
,
()
=>
{
expect
(
expect
(
wrapper
.
find
(
IssueDueDate
).
find
(
'
.board-card-info-text
'
).
text
()).
toBe
(
'
Nov 22, 2010
'
);
wrapper
.
find
(
IssueDueDate
)
.
find
(
'
.board-card-info-text
'
)
.
text
(),
).
toBe
(
'
Nov 22, 2010
'
);
});
});
});
});
});
});
spec/frontend/issuable/related_issues/components/related_issues_root_spec.js
View file @
21fa9ca4
...
@@ -315,9 +315,7 @@ describe('RelatedIssuesRoot', () => {
...
@@ -315,9 +315,7 @@ describe('RelatedIssuesRoot', () => {
const
input
=
23
;
const
input
=
23
;
wrapper
.
vm
.
onInput
({
wrapper
.
vm
.
onInput
({
untouchedRawReferences
:
String
(
input
)
untouchedRawReferences
:
String
(
input
).
trim
().
split
(
/
\s
/
),
.
trim
()
.
split
(
/
\s
/
),
touchedReference
:
input
,
touchedReference
:
input
,
});
});
...
...
spec/frontend/issuable_list/components/issuable_item_spec.js
View file @
21fa9ca4
...
@@ -252,12 +252,9 @@ describe('IssuableItem', () => {
...
@@ -252,12 +252,9 @@ describe('IssuableItem', () => {
await
wrapper
.
vm
.
$nextTick
();
await
wrapper
.
vm
.
$nextTick
();
expect
(
expect
(
wrapper
.
find
(
'
[data-testid="issuable-title"]
'
).
find
(
GlLink
).
attributes
(
'
target
'
)).
toBe
(
wrapper
'
_blank
'
,
.
find
(
'
[data-testid="issuable-title"]
'
)
);
.
find
(
GlLink
)
.
attributes
(
'
target
'
),
).
toBe
(
'
_blank
'
);
});
});
it
(
'
renders issuable reference
'
,
()
=>
{
it
(
'
renders issuable reference
'
,
()
=>
{
...
...
spec/frontend/issuable_show/components/issuable_body_spec.js
View file @
21fa9ca4
...
@@ -98,10 +98,7 @@ describe('IssuableBody', () => {
...
@@ -98,10 +98,7 @@ describe('IssuableBody', () => {
it
(
'
renders issuable edit info
'
,
()
=>
{
it
(
'
renders issuable edit info
'
,
()
=>
{
const
editedEl
=
wrapper
.
find
(
'
small
'
);
const
editedEl
=
wrapper
.
find
(
'
small
'
);
const
sanitizedText
=
editedEl
const
sanitizedText
=
editedEl
.
text
().
replace
(
/
\n
/g
,
'
'
).
replace
(
/
\s
+/g
,
'
'
);
.
text
()
.
replace
(
/
\n
/g
,
'
'
)
.
replace
(
/
\s
+/g
,
'
'
);
expect
(
sanitizedText
).
toContain
(
'
Edited
'
);
expect
(
sanitizedText
).
toContain
(
'
Edited
'
);
expect
(
sanitizedText
).
toContain
(
'
ago
'
);
expect
(
sanitizedText
).
toContain
(
'
ago
'
);
...
...
spec/frontend/issuable_suggestions/components/app_spec.js
View file @
21fa9ca4
...
@@ -85,12 +85,7 @@ describe('Issuable suggestions app component', () => {
...
@@ -85,12 +85,7 @@ describe('Issuable suggestions app component', () => {
wrapper
.
setData
(
data
);
wrapper
.
setData
(
data
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
expect
(
wrapper
.
findAll
(
'
li
'
).
at
(
0
).
classes
()).
toContain
(
'
gl-mb-3
'
);
wrapper
.
findAll
(
'
li
'
)
.
at
(
0
)
.
classes
(),
).
toContain
(
'
gl-mb-3
'
);
});
});
});
});
...
@@ -98,12 +93,7 @@ describe('Issuable suggestions app component', () => {
...
@@ -98,12 +93,7 @@ describe('Issuable suggestions app component', () => {
wrapper
.
setData
(
data
);
wrapper
.
setData
(
data
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
expect
(
wrapper
.
findAll
(
'
li
'
).
at
(
1
).
classes
()).
not
.
toContain
(
'
gl-mb-3
'
);
wrapper
.
findAll
(
'
li
'
)
.
at
(
1
)
.
classes
(),
).
not
.
toContain
(
'
gl-mb-3
'
);
});
});
});
});
});
});
...
...
spec/frontend/issue_show/components/header_actions_spec.js
View file @
21fa9ca4
...
@@ -70,10 +70,7 @@ describe('HeaderActions component', () => {
...
@@ -70,10 +70,7 @@ describe('HeaderActions component', () => {
const
findModal
=
()
=>
wrapper
.
find
(
GlModal
);
const
findModal
=
()
=>
wrapper
.
find
(
GlModal
);
const
findModalLinkAt
=
index
=>
const
findModalLinkAt
=
index
=>
findModal
().
findAll
(
GlLink
).
at
(
index
);
findModal
()
.
findAll
(
GlLink
)
.
at
(
index
);
const
mountComponent
=
({
const
mountComponent
=
({
props
=
{},
props
=
{},
...
...
spec/frontend/issue_show/components/pinned_links_spec.js
View file @
21fa9ca4
...
@@ -26,11 +26,7 @@ describe('PinnedLinks', () => {
...
@@ -26,11 +26,7 @@ describe('PinnedLinks', () => {
zoomMeetingUrl
:
`<a href="
${
plainZoomUrl
}
">Zoom</a>`
,
zoomMeetingUrl
:
`<a href="
${
plainZoomUrl
}
">Zoom</a>`
,
});
});
expect
(
expect
(
findButtons
().
at
(
0
).
text
()).
toBe
(
JOIN_ZOOM_MEETING
);
findButtons
()
.
at
(
0
)
.
text
(),
).
toBe
(
JOIN_ZOOM_MEETING
);
});
});
it
(
'
displays Status link
'
,
()
=>
{
it
(
'
displays Status link
'
,
()
=>
{
...
@@ -38,11 +34,7 @@ describe('PinnedLinks', () => {
...
@@ -38,11 +34,7 @@ describe('PinnedLinks', () => {
publishedIncidentUrl
:
`<a href="
${
plainStatusUrl
}
">Status</a>`
,
publishedIncidentUrl
:
`<a href="
${
plainStatusUrl
}
">Status</a>`
,
});
});
expect
(
expect
(
findButtons
().
at
(
0
).
text
()).
toBe
(
STATUS_PAGE_PUBLISHED
);
findButtons
()
.
at
(
0
)
.
text
(),
).
toBe
(
STATUS_PAGE_PUBLISHED
);
});
});
it
(
'
does not render if there are no links
'
,
()
=>
{
it
(
'
does not render if there are no links
'
,
()
=>
{
...
...
spec/frontend/issues_list/components/issuables_list_app_spec.js
View file @
21fa9ca4
...
@@ -238,15 +238,15 @@ describe('Issuables list component', () => {
...
@@ -238,15 +238,15 @@ describe('Issuables list component', () => {
wrapper
.
vm
.
onSelectIssuable
({
issuable
:
i0
,
selected
:
false
});
wrapper
.
vm
.
onSelectIssuable
({
issuable
:
i0
,
selected
:
false
});
expect
(
wrapper
.
vm
.
selection
).
toEqual
({});
expect
(
wrapper
.
vm
.
selection
).
toEqual
({});
wrapper
.
vm
.
onSelectIssuable
({
issuable
:
i1
,
selected
:
true
});
wrapper
.
vm
.
onSelectIssuable
({
issuable
:
i1
,
selected
:
true
});
expect
(
wrapper
.
vm
.
selection
).
toEqual
({
'
1
'
:
true
});
expect
(
wrapper
.
vm
.
selection
).
toEqual
({
1
:
true
});
wrapper
.
vm
.
onSelectIssuable
({
issuable
:
i0
,
selected
:
true
});
wrapper
.
vm
.
onSelectIssuable
({
issuable
:
i0
,
selected
:
true
});
expect
(
wrapper
.
vm
.
selection
).
toEqual
({
'
1
'
:
true
,
'
0
'
:
true
});
expect
(
wrapper
.
vm
.
selection
).
toEqual
({
1
:
true
,
0
:
true
});
wrapper
.
vm
.
onSelectIssuable
({
issuable
:
i2
,
selected
:
true
});
wrapper
.
vm
.
onSelectIssuable
({
issuable
:
i2
,
selected
:
true
});
expect
(
wrapper
.
vm
.
selection
).
toEqual
({
'
1
'
:
true
,
'
0
'
:
true
,
'
2
'
:
true
});
expect
(
wrapper
.
vm
.
selection
).
toEqual
({
1
:
true
,
0
:
true
,
2
:
true
});
wrapper
.
vm
.
onSelectIssuable
({
issuable
:
i2
,
selected
:
true
});
wrapper
.
vm
.
onSelectIssuable
({
issuable
:
i2
,
selected
:
true
});
expect
(
wrapper
.
vm
.
selection
).
toEqual
({
'
1
'
:
true
,
'
0
'
:
true
,
'
2
'
:
true
});
expect
(
wrapper
.
vm
.
selection
).
toEqual
({
1
:
true
,
0
:
true
,
2
:
true
});
wrapper
.
vm
.
onSelectIssuable
({
issuable
:
i0
,
selected
:
false
});
wrapper
.
vm
.
onSelectIssuable
({
issuable
:
i0
,
selected
:
false
});
expect
(
wrapper
.
vm
.
selection
).
toEqual
({
'
1
'
:
true
,
'
2
'
:
true
});
expect
(
wrapper
.
vm
.
selection
).
toEqual
({
1
:
true
,
2
:
true
});
});
});
it
(
'
broadcasts a message to the bulk edit sidebar when a value is added to selection
'
,
()
=>
{
it
(
'
broadcasts a message to the bulk edit sidebar when a value is added to selection
'
,
()
=>
{
...
...
spec/frontend/jobs/components/empty_state_spec.js
View file @
21fa9ca4
...
@@ -46,11 +46,7 @@ describe('Empty State', () => {
...
@@ -46,11 +46,7 @@ describe('Empty State', () => {
});
});
it
(
'
renders provided title
'
,
()
=>
{
it
(
'
renders provided title
'
,
()
=>
{
expect
(
expect
(
findTitle
().
text
().
trim
()).
toBe
(
defaultProps
.
title
);
findTitle
()
.
text
()
.
trim
(),
).
toBe
(
defaultProps
.
title
);
});
});
});
});
...
@@ -60,11 +56,7 @@ describe('Empty State', () => {
...
@@ -60,11 +56,7 @@ describe('Empty State', () => {
});
});
it
(
'
renders content
'
,
()
=>
{
it
(
'
renders content
'
,
()
=>
{
expect
(
expect
(
findContent
().
text
().
trim
()).
toBe
(
content
);
findContent
()
.
text
()
.
trim
(),
).
toBe
(
content
);
});
});
});
});
...
...
spec/frontend/jobs/components/job_app_spec.js
View file @
21fa9ca4
...
@@ -133,13 +133,9 @@ describe('Job App', () => {
...
@@ -133,13 +133,9 @@ describe('Job App', () => {
});
});
it
(
'
should render provided job information
'
,
()
=>
{
it
(
'
should render provided job information
'
,
()
=>
{
expect
(
expect
(
wrapper
.
find
(
'
.header-main-content
'
).
text
().
replace
(
/
\s
+/g
,
'
'
).
trim
()).
toContain
(
wrapper
'
passed Job #4757 triggered 1 year ago by Root
'
,
.
find
(
'
.header-main-content
'
)
);
.
text
()
.
replace
(
/
\s
+/g
,
'
'
)
.
trim
(),
).
toContain
(
'
passed Job #4757 triggered 1 year ago by Root
'
);
});
});
it
(
'
should render new issue link
'
,
()
=>
{
it
(
'
should render new issue link
'
,
()
=>
{
...
@@ -151,11 +147,7 @@ describe('Job App', () => {
...
@@ -151,11 +147,7 @@ describe('Job App', () => {
it
(
'
should render created key
'
,
()
=>
it
(
'
should render created key
'
,
()
=>
setupAndMount
().
then
(()
=>
{
setupAndMount
().
then
(()
=>
{
expect
(
expect
(
wrapper
wrapper
.
find
(
'
.header-main-content
'
).
text
().
replace
(
/
\s
+/g
,
'
'
).
trim
(),
.
find
(
'
.header-main-content
'
)
.
text
()
.
replace
(
/
\s
+/g
,
'
'
)
.
trim
(),
).
toContain
(
'
passed Job #4757 created 3 weeks ago by Root
'
);
).
toContain
(
'
passed Job #4757 created 3 weeks ago by Root
'
);
}));
}));
});
});
...
...
spec/frontend/jobs/components/log/line_spec.js
View file @
21fa9ca4
...
@@ -34,10 +34,7 @@ describe('Job Log Line', () => {
...
@@ -34,10 +34,7 @@ describe('Job Log Line', () => {
const
findLine
=
()
=>
wrapper
.
find
(
'
span
'
);
const
findLine
=
()
=>
wrapper
.
find
(
'
span
'
);
const
findLink
=
()
=>
findLine
().
find
(
'
a
'
);
const
findLink
=
()
=>
findLine
().
find
(
'
a
'
);
const
findLinks
=
()
=>
findLine
().
findAll
(
'
a
'
);
const
findLinks
=
()
=>
findLine
().
findAll
(
'
a
'
);
const
findLinkAttributeByIndex
=
i
=>
const
findLinkAttributeByIndex
=
i
=>
findLinks
().
at
(
i
).
attributes
();
findLinks
()
.
at
(
i
)
.
attributes
();
beforeEach
(()
=>
{
beforeEach
(()
=>
{
data
=
mockProps
();
data
=
mockProps
();
...
...
spec/frontend/jobs/components/log/log_spec.js
View file @
21fa9ca4
...
@@ -62,11 +62,7 @@ describe('Job Log', () => {
...
@@ -62,11 +62,7 @@ describe('Job Log', () => {
});
});
it
(
'
renders an icon with the open state
'
,
()
=>
{
it
(
'
renders an icon with the open state
'
,
()
=>
{
expect
(
expect
(
findCollapsibleLine
().
find
(
'
[data-testid="angle-down-icon"]
'
).
exists
()).
toBe
(
true
);
findCollapsibleLine
()
.
find
(
'
[data-testid="angle-down-icon"]
'
)
.
exists
(),
).
toBe
(
true
);
});
});
describe
(
'
on click header section
'
,
()
=>
{
describe
(
'
on click header section
'
,
()
=>
{
...
...
spec/frontend/lib/utils/chart_utils_spec.js
View file @
21fa9ca4
...
@@ -3,7 +3,11 @@ import { firstAndLastY } from '~/lib/utils/chart_utils';
...
@@ -3,7 +3,11 @@ import { firstAndLastY } from '~/lib/utils/chart_utils';
describe
(
'
Chart utils
'
,
()
=>
{
describe
(
'
Chart utils
'
,
()
=>
{
describe
(
'
firstAndLastY
'
,
()
=>
{
describe
(
'
firstAndLastY
'
,
()
=>
{
it
(
'
returns the first and last y-values of a given data set as an array
'
,
()
=>
{
it
(
'
returns the first and last y-values of a given data set as an array
'
,
()
=>
{
const
data
=
[[
''
,
1
],
[
''
,
2
],
[
''
,
3
]];
const
data
=
[
[
''
,
1
],
[
''
,
2
],
[
''
,
3
],
];
expect
(
firstAndLastY
(
data
)).
toEqual
([
1
,
3
]);
expect
(
firstAndLastY
(
data
)).
toEqual
([
1
,
3
]);
});
});
...
...
spec/frontend/logs/components/environment_logs_spec.js
View file @
21fa9ca4
...
@@ -181,11 +181,7 @@ describe('EnvironmentLogs', () => {
...
@@ -181,11 +181,7 @@ describe('EnvironmentLogs', () => {
it
(
'
shows a logs trace
'
,
()
=>
{
it
(
'
shows a logs trace
'
,
()
=>
{
expect
(
findLogTrace
().
text
()).
toBe
(
''
);
expect
(
findLogTrace
().
text
()).
toBe
(
''
);
expect
(
expect
(
findLogTrace
().
find
(
'
.js-build-loader-animation
'
).
isVisible
()).
toBe
(
true
);
findLogTrace
()
.
find
(
'
.js-build-loader-animation
'
)
.
isVisible
(),
).
toBe
(
true
);
});
});
});
});
...
...
spec/frontend/members/components/action_buttons/resend_invite_button_spec.js
View file @
21fa9ca4
...
@@ -57,10 +57,8 @@ describe('ResendInviteButton', () => {
...
@@ -57,10 +57,8 @@ describe('ResendInviteButton', () => {
it
(
'
displays form with correct action and inputs
'
,
()
=>
{
it
(
'
displays form with correct action and inputs
'
,
()
=>
{
expect
(
findForm
().
attributes
(
'
action
'
)).
toBe
(
'
/groups/foo-bar/-/group_members/1/resend_invite
'
);
expect
(
findForm
().
attributes
(
'
action
'
)).
toBe
(
'
/groups/foo-bar/-/group_members/1/resend_invite
'
);
expect
(
expect
(
findForm
().
find
(
'
input[name="authenticity_token"]
'
).
attributes
(
'
value
'
)).
toBe
(
findForm
()
'
mock-csrf-token
'
,
.
find
(
'
input[name="authenticity_token"]
'
)
);
.
attributes
(
'
value
'
),
).
toBe
(
'
mock-csrf-token
'
);
});
});
});
});
spec/frontend/members/components/filter_sort/members_filtered_search_bar_spec.js
View file @
21fa9ca4
...
@@ -86,7 +86,10 @@ describe('MembersFilteredSearchBar', () => {
...
@@ -86,7 +86,10 @@ describe('MembersFilteredSearchBar', () => {
token
:
GlFilteredSearchToken
,
token
:
GlFilteredSearchToken
,
unique
:
true
,
unique
:
true
,
operators
:
[{
value
:
'
=
'
,
description
:
'
is
'
}],
operators
:
[{
value
:
'
=
'
,
description
:
'
is
'
}],
options
:
[{
value
:
'
exclude
'
,
title
:
'
Direct
'
},
{
value
:
'
only
'
,
title
:
'
Inherited
'
}],
options
:
[
{
value
:
'
exclude
'
,
title
:
'
Direct
'
},
{
value
:
'
only
'
,
title
:
'
Inherited
'
},
],
},
},
]);
]);
});
});
...
...
spec/frontend/members/components/table/expiration_datepicker_spec.js
View file @
21fa9ca4
...
@@ -72,11 +72,9 @@ describe('ExpirationDatepicker', () => {
...
@@ -72,11 +72,9 @@ describe('ExpirationDatepicker', () => {
});
});
it
(
'
sets `minDate` prop as tomorrow
'
,
()
=>
{
it
(
'
sets `minDate` prop as tomorrow
'
,
()
=>
{
expect
(
expect
(
findDatepicker
().
props
(
'
minDate
'
).
toISOString
()).
toBe
(
findDatepicker
()
new
Date
(
'
2020-3-16
'
).
toISOString
(),
.
props
(
'
minDate
'
)
);
.
toISOString
(),
).
toBe
(
new
Date
(
'
2020-3-16
'
).
toISOString
());
});
});
it
(
'
sets `target` prop as `null` so datepicker opens on focus
'
,
()
=>
{
it
(
'
sets `target` prop as `null` so datepicker opens on focus
'
,
()
=>
{
...
...
spec/frontend/members/components/table/members_table_spec.js
View file @
21fa9ca4
...
@@ -100,10 +100,7 @@ describe('MembersTable', () => {
...
@@ -100,10 +100,7 @@ describe('MembersTable', () => {
if
(
expectedComponent
)
{
if
(
expectedComponent
)
{
expect
(
expect
(
wrapper
wrapper
.
find
(
`[data-label="
${
label
}
"][role="cell"]`
).
find
(
expectedComponent
).
exists
(),
.
find
(
`[data-label="
${
label
}
"][role="cell"]`
)
.
find
(
expectedComponent
)
.
exists
(),
).
toBe
(
true
);
).
toBe
(
true
);
}
}
});
});
...
@@ -117,10 +114,7 @@ describe('MembersTable', () => {
...
@@ -117,10 +114,7 @@ describe('MembersTable', () => {
expect
(
actionField
.
exists
()).
toBe
(
true
);
expect
(
actionField
.
exists
()).
toBe
(
true
);
expect
(
actionField
.
classes
(
'
gl-sr-only
'
)).
toBe
(
true
);
expect
(
actionField
.
classes
(
'
gl-sr-only
'
)).
toBe
(
true
);
expect
(
expect
(
wrapper
wrapper
.
find
(
`[data-label="Actions"][role="cell"]`
).
find
(
MemberActionButtons
).
exists
(),
.
find
(
`[data-label="Actions"][role="cell"]`
)
.
find
(
MemberActionButtons
)
.
exists
(),
).
toBe
(
true
);
).
toBe
(
true
);
});
});
...
@@ -177,12 +171,9 @@ describe('MembersTable', () => {
...
@@ -177,12 +171,9 @@ describe('MembersTable', () => {
it('renders badge in "Max role" field', () => {
it('renders badge in "Max role" field', () => {
createComponent({ members: [memberMock], tableFields: ['maxRole'] });
createComponent({ members: [memberMock], tableFields: ['maxRole'] });
expect(
expect(wrapper.find(`
[
data
-
label
=
"
Max role
"
][
role
=
"
cell
"
]
`).find(GlBadge).text()).toBe(
wrapper
memberMock.accessLevel.stringValue,
.find(`
[
data
-
label
=
"
Max role
"
][
role
=
"
cell
"
]
`)
);
.find(GlBadge)
.text(),
).toBe(memberMock.accessLevel.stringValue);
});
});
});
});
...
@@ -203,10 +194,6 @@ describe('MembersTable', () => {
...
@@ -203,10 +194,6 @@ describe('MembersTable', () => {
it('adds QA selector to table row', () => {
it('adds QA selector to table row', () => {
createComponent();
createComponent();
expect(
expect(findTable().find('tbody tr').attributes('data-qa-selector')).toBe('member_row');
findTable()
.find('tbody tr')
.attributes('data-qa-selector'),
).toBe('member_row');
});
});
});
});
spec/frontend/milestones/milestone_combobox_spec.js
View file @
21fa9ca4
...
@@ -336,9 +336,7 @@ describe('Milestone combobox component', () => {
...
@@ -336,9 +336,7 @@ describe('Milestone combobox component', () => {
await
localVue
.
nextTick
();
await
localVue
.
nextTick
();
expect
(
expect
(
findFirstProjectMilestonesDropdownItem
()
findFirstProjectMilestonesDropdownItem
().
find
(
'
span
'
).
classes
(
'
selected-item
'
),
.
find
(
'
span
'
)
.
classes
(
'
selected-item
'
),
).
toBe
(
false
);
).
toBe
(
false
);
selectFirstProjectMilestone
();
selectFirstProjectMilestone
();
...
@@ -346,9 +344,7 @@ describe('Milestone combobox component', () => {
...
@@ -346,9 +344,7 @@ describe('Milestone combobox component', () => {
await
localVue
.
nextTick
();
await
localVue
.
nextTick
();
expect
(
expect
(
findFirstProjectMilestonesDropdownItem
()
findFirstProjectMilestonesDropdownItem
().
find
(
'
span
'
).
classes
(
'
selected-item
'
),
.
find
(
'
span
'
)
.
classes
(
'
selected-item
'
),
).
toBe
(
true
);
).
toBe
(
true
);
});
});
...
@@ -465,21 +461,17 @@ describe('Milestone combobox component', () => {
...
@@ -465,21 +461,17 @@ describe('Milestone combobox component', () => {
await
localVue
.
nextTick
();
await
localVue
.
nextTick
();
expect
(
expect
(
findFirstGroupMilestonesDropdownItem
().
find
(
'
span
'
).
classes
(
'
selected-item
'
)).
toBe
(
findFirstGroupMilestonesDropdownItem
()
false
,
.
find
(
'
span
'
)
);
.
classes
(
'
selected-item
'
),
).
toBe
(
false
);
selectFirstGroupMilestone
();
selectFirstGroupMilestone
();
await
localVue
.
nextTick
();
await
localVue
.
nextTick
();
expect
(
expect
(
findFirstGroupMilestonesDropdownItem
().
find
(
'
span
'
).
classes
(
'
selected-item
'
)).
toBe
(
findFirstGroupMilestonesDropdownItem
()
true
,
.
find
(
'
span
'
)
);
.
classes
(
'
selected-item
'
),
).
toBe
(
true
);
});
});
describe
(
'
when a group milestones is selected
'
,
()
=>
{
describe
(
'
when a group milestones is selected
'
,
()
=>
{
...
...
spec/frontend/monitoring/alert_widget_spec.js
View file @
21fa9ca4
...
@@ -28,12 +28,20 @@ describe('AlertWidget', () => {
...
@@ -28,12 +28,20 @@ describe('AlertWidget', () => {
const
nonFiringAlertResult
=
[
const
nonFiringAlertResult
=
[
{
{
values
:
[[
0
,
1
],
[
1
,
42
],
[
2
,
41
]],
values
:
[
[
0
,
1
],
[
1
,
42
],
[
2
,
41
],
],
},
},
];
];
const
firingAlertResult
=
[
const
firingAlertResult
=
[
{
{
values
:
[[
0
,
42
],
[
1
,
43
],
[
2
,
44
]],
values
:
[
[
0
,
42
],
[
1
,
43
],
[
2
,
44
],
],
},
},
];
];
const
metricId
=
'
5
'
;
const
metricId
=
'
5
'
;
...
@@ -88,10 +96,7 @@ describe('AlertWidget', () => {
...
@@ -88,10 +96,7 @@ describe('AlertWidget', () => {
const
findWidgetForm
=
()
=>
wrapper
.
find
({
ref
:
'
widgetForm
'
});
const
findWidgetForm
=
()
=>
wrapper
.
find
({
ref
:
'
widgetForm
'
});
const
findAlertErrorMessage
=
()
=>
wrapper
.
find
({
ref
:
'
alertErrorMessage
'
});
const
findAlertErrorMessage
=
()
=>
wrapper
.
find
({
ref
:
'
alertErrorMessage
'
});
const
findCurrentSettingsText
=
()
=>
const
findCurrentSettingsText
=
()
=>
wrapper
wrapper
.
find
({
ref
:
'
alertCurrentSetting
'
}).
text
().
replace
(
/
\s\s
+/g
,
'
'
);
.
find
({
ref
:
'
alertCurrentSetting
'
})
.
text
()
.
replace
(
/
\s\s
+/g
,
'
'
);
const
findBadge
=
()
=>
wrapper
.
find
(
GlBadge
);
const
findBadge
=
()
=>
wrapper
.
find
(
GlBadge
);
const
findTooltip
=
()
=>
wrapper
.
find
(
GlTooltip
);
const
findTooltip
=
()
=>
wrapper
.
find
(
GlTooltip
);
...
@@ -300,11 +305,7 @@ describe('AlertWidget', () => {
...
@@ -300,11 +305,7 @@ describe('AlertWidget', () => {
createComponent
(
propsWithManyAlerts
);
createComponent
(
propsWithManyAlerts
);
return
waitForPromises
().
then
(()
=>
{
return
waitForPromises
().
then
(()
=>
{
expect
(
expect
(
findTooltip
().
text
().
replace
(
/
\s\s
+/g
,
'
'
)).
toEqual
(
'
Firing: alert-label > 42
'
);
findTooltip
()
.
text
()
.
replace
(
/
\s\s
+/g
,
'
'
),
).
toEqual
(
'
Firing: alert-label > 42
'
);
});
});
});
});
});
});
...
...
spec/frontend/monitoring/components/dashboard_panel_spec.js
View file @
21fa9ca4
...
@@ -777,11 +777,7 @@ describe('Dashboard Panel', () => {
...
@@ -777,11 +777,7 @@ describe('Dashboard Panel', () => {
await
wrapper
.
vm
.
$nextTick
();
await
wrapper
.
vm
.
$nextTick
();
expect
(
findRunbookLinks
().
length
).
toBe
(
1
);
expect
(
findRunbookLinks
().
length
).
toBe
(
1
);
expect
(
expect
(
findRunbookLinks
().
at
(
0
).
attributes
(
'
href
'
)).
toBe
(
invalidUrl
);
findRunbookLinks
()
.
at
(
0
)
.
attributes
(
'
href
'
),
).
toBe
(
invalidUrl
);
});
});
});
});
});
});
...
...
spec/frontend/monitoring/components/dashboard_spec.js
View file @
21fa9ca4
...
@@ -587,12 +587,9 @@ describe('Dashboard', () => {
...
@@ -587,12 +587,9 @@ describe('Dashboard', () => {
});
});
it
(
'
group empty area displays a NO_DATA state
'
,
()
=>
{
it
(
'
group empty area displays a NO_DATA state
'
,
()
=>
{
expect
(
expect
(
wrapper
.
findAll
({
ref
:
'
empty-group
'
}).
at
(
0
).
props
(
'
selectedState
'
)).
toEqual
(
wrapper
metricStates
.
NO_DATA
,
.
findAll
({
ref
:
'
empty-group
'
})
);
.
at
(
0
)
.
props
(
'
selectedState
'
),
).
toEqual
(
metricStates
.
NO_DATA
);
});
});
});
});
...
@@ -634,9 +631,7 @@ describe('Dashboard', () => {
...
@@ -634,9 +631,7 @@ describe('Dashboard', () => {
describe
(
'
when rearrange button is clicked
'
,
()
=>
{
describe
(
'
when rearrange button is clicked
'
,
()
=>
{
const
findFirstDraggableRemoveButton
=
()
=>
const
findFirstDraggableRemoveButton
=
()
=>
findDraggablePanels
()
findDraggablePanels
().
at
(
0
).
find
(
'
.js-draggable-remove
'
);
.
at
(
0
)
.
find
(
'
.js-draggable-remove
'
);
beforeEach
(()
=>
{
beforeEach
(()
=>
{
findRearrangeButton
().
vm
.
$emit
(
'
click
'
);
findRearrangeButton
().
vm
.
$emit
(
'
click
'
);
...
@@ -668,11 +663,7 @@ describe('Dashboard', () => {
...
@@ -668,11 +663,7 @@ describe('Dashboard', () => {
});
});
it
(
'
shows a remove button, which removes a panel
'
,
()
=>
{
it
(
'
shows a remove button, which removes a panel
'
,
()
=>
{
expect
(
expect
(
findFirstDraggableRemoveButton
().
find
(
'
a
'
).
exists
()).
toBe
(
true
);
findFirstDraggableRemoveButton
()
.
find
(
'
a
'
)
.
exists
(),
).
toBe
(
true
);
expect
(
findDraggablePanels
().
length
).
toEqual
(
metricsDashboardPanelCount
);
expect
(
findDraggablePanels
().
length
).
toEqual
(
metricsDashboardPanelCount
);
findFirstDraggableRemoveButton
().
trigger
(
'
click
'
);
findFirstDraggableRemoveButton
().
trigger
(
'
click
'
);
...
@@ -772,10 +763,7 @@ describe('Dashboard', () => {
...
@@ -772,10 +763,7 @@ describe('Dashboard', () => {
const
panelIndex
=
1
;
// skip expanded panel
const
panelIndex
=
1
;
// skip expanded panel
const
getClipboardTextFirstPanel
=
()
=>
const
getClipboardTextFirstPanel
=
()
=>
wrapper
wrapper
.
findAll
(
DashboardPanel
).
at
(
panelIndex
).
props
(
'
clipboardText
'
);
.
findAll
(
DashboardPanel
)
.
at
(
panelIndex
)
.
props
(
'
clipboardText
'
);
beforeEach
(()
=>
{
beforeEach
(()
=>
{
setupStoreWithData
(
store
);
setupStoreWithData
(
store
);
...
...
spec/frontend/monitoring/components/duplicate_dashboard_modal_spec.js
View file @
21fa9ca4
...
@@ -101,9 +101,7 @@ describe('duplicate dashboard modal', () => {
...
@@ -101,9 +101,7 @@ describe('duplicate dashboard modal', () => {
commitMessage
:
'
A commit message
'
,
commitMessage
:
'
A commit message
'
,
};
};
findModal
()
findModal
().
find
(
DuplicateDashboardForm
).
vm
.
$emit
(
'
change
'
,
formVals
);
.
find
(
DuplicateDashboardForm
)
.
vm
.
$emit
(
'
change
'
,
formVals
);
// Binding's second argument contains the modal id
// Binding's second argument contains the modal id
expect
(
wrapper
.
vm
.
form
).
toEqual
(
formVals
);
expect
(
wrapper
.
vm
.
form
).
toEqual
(
formVals
);
...
...
spec/frontend/monitoring/components/variables/dropdown_field_spec.js
View file @
21fa9ca4
...
@@ -10,7 +10,10 @@ describe('Custom variable component', () => {
...
@@ -10,7 +10,10 @@ describe('Custom variable component', () => {
label
:
'
Select environment
'
,
label
:
'
Select environment
'
,
value
:
'
Production
'
,
value
:
'
Production
'
,
options
:
{
options
:
{
values
:
[{
text
:
'
Production
'
,
value
:
'
prod
'
},
{
text
:
'
Canary
'
,
value
:
'
canary
'
}],
values
:
[
{
text
:
'
Production
'
,
value
:
'
prod
'
},
{
text
:
'
Canary
'
,
value
:
'
canary
'
},
],
},
},
};
};
...
@@ -54,9 +57,7 @@ describe('Custom variable component', () => {
...
@@ -54,9 +57,7 @@ describe('Custom variable component', () => {
createShallowWrapper
();
createShallowWrapper
();
jest
.
spyOn
(
wrapper
.
vm
,
'
$emit
'
);
jest
.
spyOn
(
wrapper
.
vm
,
'
$emit
'
);
findDropdownItems
()
findDropdownItems
().
at
(
1
).
vm
.
$emit
(
'
click
'
);
.
at
(
1
)
.
vm
.
$emit
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
return
wrapper
.
vm
.
$nextTick
(()
=>
{
expect
(
wrapper
.
vm
.
$emit
).
toHaveBeenCalledWith
(
'
input
'
,
'
canary
'
);
expect
(
wrapper
.
vm
.
$emit
).
toHaveBeenCalledWith
(
'
input
'
,
'
canary
'
);
...
...
spec/frontend/monitoring/router_spec.js
View file @
21fa9ca4
...
@@ -63,12 +63,7 @@ describe('Monitoring router', () => {
...
@@ -63,12 +63,7 @@ describe('Monitoring router', () => {
});
});
expect
(
wrapper
.
find
(
DashboardPage
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
DashboardPage
).
exists
()).
toBe
(
true
);
expect
(
expect
(
wrapper
.
find
(
DashboardPage
).
find
(
Dashboard
).
exists
()).
toBe
(
true
);
wrapper
.
find
(
DashboardPage
)
.
find
(
Dashboard
)
.
exists
(),
).
toBe
(
true
);
});
});
});
});
...
@@ -91,12 +86,7 @@ describe('Monitoring router', () => {
...
@@ -91,12 +86,7 @@ describe('Monitoring router', () => {
});
});
expect
(
wrapper
.
find
(
DashboardPage
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
DashboardPage
).
exists
()).
toBe
(
true
);
expect
(
expect
(
wrapper
.
find
(
DashboardPage
).
find
(
Dashboard
).
exists
()).
toBe
(
true
);
wrapper
.
find
(
DashboardPage
)
.
find
(
Dashboard
)
.
exists
(),
).
toBe
(
true
);
});
});
});
});
...
...
spec/frontend/monitoring/store/mutations_spec.js
View file @
21fa9ca4
...
@@ -465,7 +465,10 @@ describe('Monitoring mutations', () => {
...
@@ -465,7 +465,10 @@ describe('Monitoring mutations', () => {
});
});
expect
(
variable
.
options
).
toEqual
({
expect
(
variable
.
options
).
toEqual
({
values
:
[{
text
:
'
prometheus
'
,
value
:
'
prometheus
'
},
{
text
:
'
node
'
,
value
:
'
node
'
}],
values
:
[
{
text
:
'
prometheus
'
,
value
:
'
prometheus
'
},
{
text
:
'
node
'
,
value
:
'
node
'
},
],
});
});
});
});
});
});
...
...
spec/frontend/monitoring/store/utils_spec.js
View file @
21fa9ca4
...
@@ -775,7 +775,11 @@ describe('normalizeQueryResponseData', () => {
...
@@ -775,7 +775,11 @@ describe('normalizeQueryResponseData', () => {
job
:
'
prometheus
'
,
job
:
'
prometheus
'
,
instance
:
'
localhost:9090
'
,
instance
:
'
localhost:9090
'
,
},
},
values
:
[[
1435781430.781
,
'
1
'
],
[
1435781445.781
,
'
2
'
],
[
1435781460.781
,
'
3
'
]],
values
:
[
[
1435781430.781
,
'
1
'
],
[
1435781445.781
,
'
2
'
],
[
1435781460.781
,
'
3
'
],
],
},
},
{
{
metric
:
{
metric
:
{
...
@@ -783,7 +787,11 @@ describe('normalizeQueryResponseData', () => {
...
@@ -783,7 +787,11 @@ describe('normalizeQueryResponseData', () => {
job
:
'
node
'
,
job
:
'
node
'
,
instance
:
'
localhost:9091
'
,
instance
:
'
localhost:9091
'
,
},
},
values
:
[[
1435781430.781
,
'
4
'
],
[
1435781445.781
,
'
5
'
],
[
1435781460.781
,
'
6
'
]],
values
:
[
[
1435781430.781
,
'
4
'
],
[
1435781445.781
,
'
5
'
],
[
1435781460.781
,
'
6
'
],
],
},
},
],
],
};
};
...
@@ -840,7 +848,10 @@ describe('normalizeQueryResponseData', () => {
...
@@ -840,7 +848,10 @@ describe('normalizeQueryResponseData', () => {
job
:
'
prometheus
'
,
job
:
'
prometheus
'
,
instance
:
'
localhost:9090
'
,
instance
:
'
localhost:9090
'
,
},
},
values
:
[[
1435781430.781
,
'
1
'
],
[
1435781460.781
,
'
NaN
'
]],
values
:
[
[
1435781430.781
,
'
1
'
],
[
1435781460.781
,
'
NaN
'
],
],
},
},
],
],
};
};
...
@@ -849,7 +860,10 @@ describe('normalizeQueryResponseData', () => {
...
@@ -849,7 +860,10 @@ describe('normalizeQueryResponseData', () => {
{
{
metric
:
{
__name__
:
'
up
'
,
instance
:
'
localhost:9090
'
,
job
:
'
prometheus
'
},
metric
:
{
__name__
:
'
up
'
,
instance
:
'
localhost:9090
'
,
job
:
'
prometheus
'
},
value
:
[
'
2015-07-01T20:11:00.781Z
'
,
NaN
],
value
:
[
'
2015-07-01T20:11:00.781Z
'
,
NaN
],
values
:
[[
'
2015-07-01T20:10:30.781Z
'
,
1
],
[
'
2015-07-01T20:11:00.781Z
'
,
NaN
]],
values
:
[
[
'
2015-07-01T20:10:30.781Z
'
,
1
],
[
'
2015-07-01T20:11:00.781Z
'
,
NaN
],
],
},
},
]);
]);
});
});
...
...
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