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
8ac8a1f2
Commit
8ac8a1f2
authored
Dec 22, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 30 spec files: 3 of 10
Mandatory not to break master. Automatically created with prettier.
parent
ed189d0e
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
128 additions
and
209 deletions
+128
-209
.prettierignore
.prettierignore
+0
-18
ee/spec/frontend/groups/components/invite_members_spec.js
ee/spec/frontend/groups/components/invite_members_spec.js
+3
-15
ee/spec/frontend/groups/settings/compliance_frameworks/components/list_spec.js
...ps/settings/compliance_frameworks/components/list_spec.js
+1
-5
ee/spec/frontend/groups/settings/components/comma_separated_list_token_selector_spec.js
...gs/components/comma_separated_list_token_selector_spec.js
+1
-3
ee/spec/frontend/incidents/components/published_cell_spec.js
ee/spec/frontend/incidents/components/published_cell_spec.js
+2
-10
ee/spec/frontend/insights/components/insights_spec.js
ee/spec/frontend/insights/components/insights_spec.js
+2
-12
ee/spec/frontend/insights/mock_data.js
ee/spec/frontend/insights/mock_data.js
+12
-3
ee/spec/frontend/insights/stores/insights/actions_spec.js
ee/spec/frontend/insights/stores/insights/actions_spec.js
+4
-1
ee/spec/frontend/insights/stores/insights/helpers_spec.js
ee/spec/frontend/insights/stores/insights/helpers_spec.js
+41
-8
ee/spec/frontend/insights/stores/insights/mutations_spec.js
ee/spec/frontend/insights/stores/insights/mutations_spec.js
+4
-1
ee/spec/frontend/issuable/related_issues/components/related_issues_list_spec.js
...ble/related_issues/components/related_issues_list_spec.js
+3
-6
ee/spec/frontend/issues_analytics/components/issues_analytics_table_spec.js
...ssues_analytics/components/issues_analytics_table_spec.js
+5
-13
ee/spec/frontend/iterations/components/iteration_report_tabs_spec.js
...ntend/iterations/components/iteration_report_tabs_spec.js
+1
-4
ee/spec/frontend/license_compliance/components/app_spec.js
ee/spec/frontend/license_compliance/components/app_spec.js
+2
-12
ee/spec/frontend/members/components/ldap/ldap_dropdown_item_spec.js
...ontend/members/components/ldap/ldap_dropdown_item_spec.js
+1
-4
ee/spec/frontend/on_demand_scans/components/profile_selector/profile_selector_spec.js
...cans/components/profile_selector/profile_selector_spec.js
+1
-3
ee/spec/frontend/oncall_schedule/add_edit_schedule_form_spec.js
...c/frontend/oncall_schedule/add_edit_schedule_form_spec.js
+1
-3
ee/spec/frontend/oncall_schedule/schedule/components/preset_weeks/weeks_header_sub_item_spec.js
...ule/components/preset_weeks/weeks_header_sub_item_spec.js
+4
-10
ee/spec/frontend/oncall_schedule/schedule/components/rotations_list_section_spec.js
...hedule/schedule/components/rotations_list_section_spec.js
+4
-11
ee/spec/frontend/pages/admin/users/reset_button_spec.js
ee/spec/frontend/pages/admin/users/reset_button_spec.js
+5
-4
ee/spec/frontend/related_items_tree/components/create_issue_form_spec.js
...d/related_items_tree/components/create_issue_form_spec.js
+1
-6
ee/spec/frontend/related_items_tree/components/state_tooltip_spec.js
...ntend/related_items_tree/components/state_tooltip_spec.js
+9
-22
ee/spec/frontend/related_items_tree/store/mutations_spec.js
ee/spec/frontend/related_items_tree/store/mutations_spec.js
+4
-1
ee/spec/frontend/roadmap/components/epic_item_container_spec.js
...c/frontend/roadmap/components/epic_item_container_spec.js
+3
-3
ee/spec/frontend/roadmap/components/epic_item_details_spec.js
...pec/frontend/roadmap/components/epic_item_details_spec.js
+3
-3
ee/spec/frontend/roadmap/components/epic_item_spec.js
ee/spec/frontend/roadmap/components/epic_item_spec.js
+4
-4
ee/spec/frontend/roadmap/components/milestones_list_section_spec.js
...ontend/roadmap/components/milestones_list_section_spec.js
+1
-3
ee/spec/frontend/roadmap/components/roadmap_shell_spec.js
ee/spec/frontend/roadmap/components/roadmap_shell_spec.js
+1
-1
ee/spec/frontend/security_configuration/components/auto_fix_settings_spec.js
...curity_configuration/components/auto_fix_settings_spec.js
+1
-4
ee/spec/frontend/security_configuration/dast_scanner_profiles_form/components/dast_scanner_profiles_form_spec.js
...ofiles_form/components/dast_scanner_profiles_form_spec.js
+3
-11
ee/spec/frontend/security_configuration/sast/components/dynamic_fields_spec.js
...rity_configuration/sast/components/dynamic_fields_spec.js
+1
-5
No files found.
.prettierignore
View file @
8ac8a1f2
...
...
@@ -11,24 +11,6 @@ doc/api/graphql/reference/gitlab_schema.graphql
*.md
# temporarly ignored in order to migrate to prettier@2 more efficiently and iteratively:
ee/spec/frontend/groups/components
ee/spec/frontend/groups/settings/
ee/spec/frontend/incidents/components
ee/spec/frontend/insights
ee/spec/frontend/issuable/related_issues/components
ee/spec/frontend/issues_analytics/components
ee/spec/frontend/iterations/components
ee/spec/frontend/license_compliance/components
ee/spec/frontend/members/components/ldap
ee/spec/frontend/on_demand_scans/components/profile_selector
ee/spec/frontend/oncall_schedule
ee/spec/frontend/pages/admin/users
ee/spec/frontend/related_items_tree/components
ee/spec/frontend/related_items_tree/store
ee/spec/frontend/roadmap/components
ee/spec/frontend/security_configuration/components
ee/spec/frontend/security_configuration/dast_scanner_profiles_form/components
ee/spec/frontend/security_configuration/sast/components
ee/spec/frontend/security_dashboard/components
ee/spec/frontend/security_dashboard/store/modules/project_selector
ee/spec/frontend/sidebar/components
...
...
ee/spec/frontend/groups/components/invite_members_spec.js
View file @
8ac8a1f2
...
...
@@ -29,11 +29,7 @@ describe('User invites', () => {
});
it
(
'
does not set a value
'
,
()
=>
{
expect
(
inputs
()
.
at
(
0
)
.
attributes
(
'
value
'
),
).
toBe
(
undefined
);
expect
(
inputs
().
at
(
0
).
attributes
(
'
value
'
)).
toBe
(
undefined
);
});
});
...
...
@@ -49,11 +45,7 @@ describe('User invites', () => {
});
it
.
each
([
0
,
1
,
2
])(
'
restores the value of the passed emails
'
,
index
=>
{
expect
(
inputs
()
.
at
(
index
)
.
attributes
(
'
value
'
),
).
toBe
(
emails
[
index
]);
expect
(
inputs
().
at
(
index
).
attributes
(
'
value
'
)).
toBe
(
emails
[
index
]);
});
});
...
...
@@ -72,11 +64,7 @@ describe('User invites', () => {
});
it
.
each
([
0
,
1
])(
'
does not set a value
'
,
index
=>
{
expect
(
inputs
()
.
at
(
index
)
.
attributes
(
'
value
'
),
).
toBe
(
undefined
);
expect
(
inputs
().
at
(
index
).
attributes
(
'
value
'
)).
toBe
(
undefined
);
});
it
(
'
sets the focus to the new input field
'
,
()
=>
{
...
...
ee/spec/frontend/groups/settings/compliance_frameworks/components/list_spec.js
View file @
8ac8a1f2
...
...
@@ -141,11 +141,7 @@ describe('List', () => {
});
it
(
'
shows the all tab
'
,
()
=>
{
expect
(
findTabs
()
.
at
(
0
)
.
attributes
(
'
title
'
),
).
toBe
(
'
All
'
);
expect
(
findTabs
().
at
(
0
).
attributes
(
'
title
'
)).
toBe
(
'
All
'
);
});
it
(
'
shows the disabled regulated tab
'
,
()
=>
{
...
...
ee/spec/frontend/groups/settings/components/comma_separated_list_token_selector_spec.js
View file @
8ac8a1f2
...
...
@@ -37,9 +37,7 @@ describe('CommaSeparatedListTokenSelector', () => {
const
findTokenSelectorDropdown
=
()
=>
findTokenSelector
().
find
(
'
[role="menu"]
'
);
const
findErrorMessageText
=
()
=>
findTokenSelector
()
.
find
(
'
[role="menuitem"][disabled="disabled"]
'
)
.
text
();
findTokenSelector
().
find
(
'
[role="menuitem"][disabled="disabled"]
'
).
text
();
const
setTokenSelectorInputValue
=
value
=>
{
const
tokenSelectorInput
=
findTokenSelectorInput
();
...
...
ee/spec/frontend/incidents/components/published_cell_spec.js
View file @
8ac8a1f2
...
...
@@ -33,11 +33,7 @@ describe('Incidents Published Cell', () => {
});
it
(
'
render a cell with unpublished by default
'
,
()
=>
{
expect
(
findCell
()
.
find
(
GlIcon
)
.
exists
(),
).
toBe
(
false
);
expect
(
findCell
().
find
(
GlIcon
).
exists
()).
toBe
(
false
);
expect
(
findCell
().
text
()).
toBe
(
'
Unpublished
'
);
});
...
...
@@ -45,11 +41,7 @@ describe('Incidents Published Cell', () => {
wrapper
.
setProps
({
statusPagePublishedIncident
:
true
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
findCell
()
.
find
(
GlIcon
)
.
exists
(),
).
toBe
(
true
);
expect
(
findCell
().
find
(
GlIcon
).
exists
()).
toBe
(
true
);
});
});
});
...
...
ee/spec/frontend/insights/components/insights_spec.js
View file @
8ac8a1f2
...
...
@@ -87,12 +87,7 @@ describe('Insights component', () => {
it
(
'
has the correct nav tabs
'
,
async
()
=>
{
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
find
(
GlDropdown
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
GlDropdown
)
.
find
(
GlDropdownItem
)
.
text
(),
).
toBe
(
title
);
expect
(
wrapper
.
find
(
GlDropdown
).
find
(
GlDropdownItem
).
text
()).
toBe
(
title
);
});
it
(
'
should not disable the tab selector
'
,
async
()
=>
{
...
...
@@ -118,12 +113,7 @@ describe('Insights component', () => {
it
(
'
has the correct nav tabs
'
,
async
()
=>
{
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
find
(
GlDropdown
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
GlDropdown
)
.
find
(
GlDropdownItem
)
.
text
(),
).
toBe
(
title
);
expect
(
wrapper
.
find
(
GlDropdown
).
find
(
GlDropdownItem
).
text
()).
toBe
(
title
);
});
it
(
'
disables the tab selector
'
,
async
()
=>
{
...
...
ee/spec/frontend/insights/mock_data.js
View file @
8ac8a1f2
...
...
@@ -15,7 +15,10 @@ export const barChartData = {
datasets
:
[
{
name
:
'
all
'
,
data
:
[[
'
January
'
,
1
],
[
'
February
'
,
2
]],
data
:
[
[
'
January
'
,
1
],
[
'
February
'
,
2
],
],
},
],
xAxisTitle
:
'
Months
'
,
...
...
@@ -26,11 +29,17 @@ export const lineChartData = {
labels
:
[
'
January
'
,
'
February
'
],
datasets
:
[
{
data
:
[[
'
January
'
,
1
],
[
'
February
'
,
2
]],
data
:
[
[
'
January
'
,
1
],
[
'
February
'
,
2
],
],
name
:
'
Alpha
'
,
},
{
data
:
[[
'
January
'
,
1
],
[
'
February
'
,
2
]],
data
:
[
[
'
January
'
,
1
],
[
'
February
'
,
2
],
],
name
:
'
Beta
'
,
},
],
...
...
ee/spec/frontend/insights/stores/insights/actions_spec.js
View file @
8ac8a1f2
...
...
@@ -266,7 +266,10 @@ describe('Insights store actions', () => {
actions
.
setActiveTab
,
key
,
state
,
[{
type
:
'
SET_ACTIVE_TAB
'
,
payload
:
key
},
{
type
:
'
SET_ACTIVE_PAGE
'
,
payload
:
page
}],
[
{
type
:
'
SET_ACTIVE_TAB
'
,
payload
:
key
},
{
type
:
'
SET_ACTIVE_PAGE
'
,
payload
:
page
},
],
[],
);
});
...
...
ee/spec/frontend/insights/stores/insights/helpers_spec.js
View file @
8ac8a1f2
...
...
@@ -10,7 +10,10 @@ describe('Insights helpers', () => {
};
const
data
=
{
labels
:
[
'
January
'
,
'
February
'
],
datasets
:
[{
label
:
'
Dataset 1
'
,
data
:
[
1
]
},
{
label
:
'
Dataset 2
'
,
data
:
[
2
]
}],
datasets
:
[
{
label
:
'
Dataset 1
'
,
data
:
[
1
]
},
{
label
:
'
Dataset 2
'
,
data
:
[
2
]
},
],
};
expect
(
transformChartDataForGlCharts
(
chart
,
data
).
xAxisTitle
).
toEqual
(
'
Months
'
);
...
...
@@ -23,7 +26,10 @@ describe('Insights helpers', () => {
};
const
data
=
{
labels
:
[
'
January
'
,
'
February
'
],
datasets
:
[{
label
:
'
Dataset 1
'
,
data
:
[
1
]
},
{
label
:
'
Dataset 2
'
,
data
:
[
2
]
}],
datasets
:
[
{
label
:
'
Dataset 1
'
,
data
:
[
1
]
},
{
label
:
'
Dataset 2
'
,
data
:
[
2
]
},
],
};
expect
(
transformChartDataForGlCharts
(
chart
,
data
).
yAxisTitle
).
toEqual
(
'
Issues
'
);
...
...
@@ -36,7 +42,10 @@ describe('Insights helpers', () => {
};
const
data
=
{
labels
:
[
'
January
'
,
'
February
'
],
datasets
:
[{
label
:
'
Dataset 1
'
,
data
:
[
1
]
},
{
label
:
'
Dataset 2
'
,
data
:
[
2
]
}],
datasets
:
[
{
label
:
'
Dataset 1
'
,
data
:
[
1
]
},
{
label
:
'
Dataset 2
'
,
data
:
[
2
]
},
],
};
expect
(
transformChartDataForGlCharts
(
chart
,
data
).
datasets
).
toEqual
([
...
...
@@ -52,12 +61,27 @@ describe('Insights helpers', () => {
};
const
data
=
{
labels
:
[
'
January
'
,
'
February
'
],
datasets
:
[{
label
:
'
Dataset 1
'
,
data
:
[
1
,
2
]
},
{
label
:
'
Dataset 2
'
,
data
:
[
2
,
3
]
}],
datasets
:
[
{
label
:
'
Dataset 1
'
,
data
:
[
1
,
2
]
},
{
label
:
'
Dataset 2
'
,
data
:
[
2
,
3
]
},
],
};
expect
(
transformChartDataForGlCharts
(
chart
,
data
).
datasets
).
toStrictEqual
([
{
name
:
'
Dataset 1
'
,
data
:
[[
'
January
'
,
1
],
[
'
February
'
,
2
]]
},
{
name
:
'
Dataset 2
'
,
data
:
[[
'
January
'
,
2
],
[
'
February
'
,
3
]]
},
{
name
:
'
Dataset 1
'
,
data
:
[
[
'
January
'
,
1
],
[
'
February
'
,
2
],
],
},
{
name
:
'
Dataset 2
'
,
data
:
[
[
'
January
'
,
2
],
[
'
February
'
,
3
],
],
},
]);
});
...
...
@@ -72,7 +96,13 @@ describe('Insights helpers', () => {
};
expect
(
transformChartDataForGlCharts
(
chart
,
data
).
datasets
).
toEqual
([
{
name
:
'
all
'
,
data
:
[[
'
January
'
,
1
],
[
'
February
'
,
2
]]
},
{
name
:
'
all
'
,
data
:
[
[
'
January
'
,
1
],
[
'
February
'
,
2
],
],
},
]);
});
...
...
@@ -87,7 +117,10 @@ describe('Insights helpers', () => {
};
expect
(
transformChartDataForGlCharts
(
chart
,
data
).
datasets
).
toEqual
({
all
:
[[
'
January
'
,
1
],
[
'
February
'
,
2
]],
all
:
[
[
'
January
'
,
1
],
[
'
February
'
,
2
],
],
});
});
});
...
...
ee/spec/frontend/insights/stores/insights/mutations_spec.js
View file @
8ac8a1f2
...
...
@@ -107,7 +107,10 @@ describe('Insights mutations', () => {
};
const
transformedData
=
{
datasets
:
[{
name
:
'
Dataset 1
'
,
data
:
[
1
]
},
{
name
:
'
Dataset 2
'
,
data
:
[
2
]
}],
datasets
:
[
{
name
:
'
Dataset 1
'
,
data
:
[
1
]
},
{
name
:
'
Dataset 2
'
,
data
:
[
2
]
},
],
labels
:
[
'
January
'
,
'
February
'
],
xAxisTitle
:
'
Months
'
,
yAxisTitle
:
'
Issues
'
,
...
...
ee/spec/frontend/issuable/related_issues/components/related_issues_list_spec.js
View file @
8ac8a1f2
...
...
@@ -29,12 +29,9 @@ describe('RelatedIssuesList', () => {
});
it
(
'
shows weight
'
,
()
=>
{
expect
(
wrapper
.
find
(
IssueWeight
)
.
find
(
'
.board-card-info-text
'
)
.
text
(),
).
toBe
(
issuable1
.
weight
.
toString
());
expect
(
wrapper
.
find
(
IssueWeight
).
find
(
'
.board-card-info-text
'
).
text
()).
toBe
(
issuable1
.
weight
.
toString
(),
);
});
});
});
ee/spec/frontend/issues_analytics/components/issues_analytics_table_spec.js
View file @
8ac8a1f2
...
...
@@ -25,19 +25,11 @@ describe('IssuesAnalyticsTable', () => {
const
findTable
=
()
=>
wrapper
.
find
(
GlTable
);
const
findIssueDetailsCol
=
rowIndex
=>
findTable
()
.
findAll
(
'
[data-testid="detailsCol"]
'
)
.
at
(
rowIndex
);
const
findAgeCol
=
rowIndex
=>
findTable
()
.
findAll
(
'
[data-testid="ageCol"]
'
)
.
at
(
rowIndex
);
const
findStatusCol
=
rowIndex
=>
findTable
()
.
findAll
(
'
[data-testid="statusCol"]
'
)
.
at
(
rowIndex
);
findTable
().
findAll
(
'
[data-testid="detailsCol"]
'
).
at
(
rowIndex
);
const
findAgeCol
=
rowIndex
=>
findTable
().
findAll
(
'
[data-testid="ageCol"]
'
).
at
(
rowIndex
);
const
findStatusCol
=
rowIndex
=>
findTable
().
findAll
(
'
[data-testid="statusCol"]
'
).
at
(
rowIndex
);
beforeEach
(()
=>
{
jest
.
spyOn
(
Date
,
'
now
'
).
mockImplementation
(()
=>
new
Date
(
'
2020-01-08
'
));
...
...
ee/spec/frontend/iterations/components/iteration_report_tabs_spec.js
View file @
8ac8a1f2
...
...
@@ -91,10 +91,7 @@ describe('Iterations report tabs', () => {
}));
const
findIssues
=
()
=>
wrapper
.
findAll
(
'
table tbody tr
'
);
const
findAssigneesForIssue
=
index
=>
findIssues
()
.
at
(
index
)
.
findAll
(
GlAvatar
);
const
findAssigneesForIssue
=
index
=>
findIssues
().
at
(
index
).
findAll
(
GlAvatar
);
beforeEach
(()
=>
{
mountComponent
();
...
...
ee/spec/frontend/license_compliance/components/app_spec.js
View file @
8ac8a1f2
...
...
@@ -279,21 +279,11 @@ describe('Project Licenses', () => {
);
it
(
'
it renders the correct count in "Detected in project" tab
'
,
()
=>
{
expect
(
wrapper
.
findAll
(
GlBadge
)
.
at
(
0
)
.
text
(),
).
toBe
(
pageInfo
.
total
.
toString
());
expect
(
wrapper
.
findAll
(
GlBadge
).
at
(
0
).
text
()).
toBe
(
pageInfo
.
total
.
toString
());
});
it
(
'
it renders the correct count in "Policies" tab
'
,
()
=>
{
expect
(
wrapper
.
findAll
(
GlBadge
)
.
at
(
1
)
.
text
(),
).
toBe
(
managedLicenses
.
length
.
toString
());
expect
(
wrapper
.
findAll
(
GlBadge
).
at
(
1
).
text
()).
toBe
(
managedLicenses
.
length
.
toString
());
});
});
...
...
ee/spec/frontend/members/components/ldap/ldap_dropdown_item_spec.js
View file @
8ac8a1f2
...
...
@@ -44,10 +44,7 @@ describe('LdapDropdownItem', () => {
beforeEach
(()
=>
{
createComponent
();
wrapper
.
find
(
GlDropdownItem
)
.
find
(
'
[role="menuitem"]
'
)
.
trigger
(
'
click
'
);
wrapper
.
find
(
GlDropdownItem
).
find
(
'
[role="menuitem"]
'
).
trigger
(
'
click
'
);
});
it
(
'
calls `updateLdapOverride` action
'
,
()
=>
{
...
...
ee/spec/frontend/on_demand_scans/components/profile_selector/profile_selector_spec.js
View file @
8ac8a1f2
...
...
@@ -27,9 +27,7 @@ describe('OnDemandScansProfileSelector', () => {
}));
const
selectFirstProfile
=
()
=>
{
return
findProfilesDropdown
()
.
find
(
GlDropdownItem
)
.
vm
.
$emit
(
'
click
'
);
return
findProfilesDropdown
().
find
(
GlDropdownItem
).
vm
.
$emit
(
'
click
'
);
};
const
createFullComponent
=
(
options
=
{})
=>
{
...
...
ee/spec/frontend/oncall_schedule/add_edit_schedule_form_spec.js
View file @
8ac8a1f2
...
...
@@ -114,9 +114,7 @@ describe('AddEditScheduleForm', () => {
});
it
(
"
doesn't have a red border when there is selected option
"
,
async
()
=>
{
findDropdownOptions
()
.
at
(
1
)
.
vm
.
$emit
(
'
click
'
);
findDropdownOptions
().
at
(
1
).
vm
.
$emit
(
'
click
'
);
await
wrapper
.
vm
.
$nextTick
();
expect
(
findTimezoneDropdown
().
classes
()).
not
.
toContain
(
'
invalid-dropdown
'
);
});
...
...
ee/spec/frontend/oncall_schedule/schedule/components/preset_weeks/weeks_header_sub_item_spec.js
View file @
8ac8a1f2
...
...
@@ -62,20 +62,14 @@ describe('WeeksHeaderSubItemComponent', () => {
it
(
'
sublabel has `label-dark` class when it is for the day greater than current week day
'
,
()
=>
{
// Timeframe starts at Jan 1, 2018, faked today is Jan 3, 2018 (3rd item in a week timeframe)
// labels for dates after current have 'label-dark' class
expect
(
findSublabelValues
()
.
at
(
3
)
.
classes
(),
).
toContain
(
'
label-dark
'
);
expect
(
findSublabelValues
().
at
(
3
).
classes
()).
toContain
(
'
label-dark
'
);
});
it
(
"
sublabel has `label-dark label-bold` classes when it is for today's date
"
,
()
=>
{
// Timeframe starts at Jan 1, 2018, faked today is Jan 3, 2018 (3rd item in a week timeframe)
expect
(
findSublabelValues
()
.
at
(
2
)
.
classes
(),
).
toEqual
(
expect
.
arrayContaining
([
'
label-dark
'
,
'
label-bold
'
]));
expect
(
findSublabelValues
().
at
(
2
).
classes
()).
toEqual
(
expect
.
arrayContaining
([
'
label-dark
'
,
'
label-bold
'
]),
);
});
});
});
ee/spec/frontend/oncall_schedule/schedule/components/rotations_list_section_spec.js
View file @
8ac8a1f2
...
...
@@ -51,20 +51,13 @@ describe('RotationsListSectionComponent', () => {
});
it
(
'
renders current day indicator in the first timeline cell
'
,
()
=>
{
expect
(
findTimelineCells
()
.
at
(
0
)
.
find
(
CurrentDayIndicator
)
.
exists
(),
).
toBe
(
true
);
expect
(
findTimelineCells
().
at
(
0
).
find
(
CurrentDayIndicator
).
exists
()).
toBe
(
true
);
});
it
(
'
render the correct amount of rotation assignees with their name, avatar and color
'
,
()
=>
{
expect
(
findRotationAssignees
()).
toHaveLength
(
2
);
expect
(
findRotationAssignees
()
.
at
(
0
)
.
props
().
assignee
.
user
,
).
toEqual
(
mockRotations
[
0
].
participants
.
nodes
[
0
].
user
);
expect
(
findRotationAssignees
().
at
(
0
).
props
().
assignee
.
user
).
toEqual
(
mockRotations
[
0
].
participants
.
nodes
[
0
].
user
,
);
});
});
ee/spec/frontend/pages/admin/users/reset_button_spec.js
View file @
8ac8a1f2
...
...
@@ -85,10 +85,11 @@ describe('Reset pipeline minutes button', () => {
return
axios
.
waitForAll
().
then
(()
=>
{
expect
(
axiosSpy
).
toHaveBeenCalled
();
expect
(
$toast
.
show
).
toHaveBeenCalledWith
(
'
There was an error resetting user pipeline minutes.
'
,
{
type
:
'
error
'
},
);
expect
(
$toast
.
show
,
).
toHaveBeenCalledWith
(
'
There was an error resetting user pipeline minutes.
'
,
{
type
:
'
error
'
,
});
});
});
});
...
...
ee/spec/frontend/related_items_tree/components/create_issue_form_spec.js
View file @
8ac8a1f2
...
...
@@ -181,12 +181,7 @@ describe('CreateIssueForm', () => {
expect
(
dropdownItems
).
toHaveLength
(
mockProjects
.
length
);
expect
(
dropdownItems
.
at
(
0
).
text
()).
toContain
(
mockProjects
[
0
].
name
);
expect
(
dropdownItems
.
at
(
0
).
text
()).
toContain
(
mockProjects
[
0
].
namespace
.
name
);
expect
(
dropdownItems
.
at
(
0
)
.
find
(
ProjectAvatar
)
.
exists
(),
).
toBe
(
true
);
expect
(
dropdownItems
.
at
(
0
).
find
(
ProjectAvatar
).
exists
()).
toBe
(
true
);
});
});
...
...
ee/spec/frontend/related_items_tree/components/state_tooltip_spec.js
View file @
8ac8a1f2
...
...
@@ -6,11 +6,13 @@ import StateTooltip from 'ee/related_items_tree/components/state_tooltip.vue';
// Ensure that mock dates dynamically computed from today
// so that test doesn't fail at any point in time.
const
currentDate
=
new
Date
();
const
mockCreatedAt
=
`
${
currentDate
.
getFullYear
()
-
2
}
-
${
currentDate
.
getMonth
()
+
1
}
-
${
currentDate
.
getDate
()}
`
;
const
mockCreatedAt
=
`
${
currentDate
.
getFullYear
()
-
2
}
-
${
currentDate
.
getMonth
()
+
1
}
-
${
currentDate
.
getDate
()}
`
;
const
mockCreatedAtYear
=
currentDate
.
getFullYear
()
-
2
;
const
mockClosedAt
=
`
${
currentDate
.
getFullYear
()
-
1
}
-
${
currentDate
.
getMonth
()
+
1
}
-
${
currentDate
.
getDate
()}
`
;
const
mockClosedAt
=
`
${
currentDate
.
getFullYear
()
-
1
}
-
${
currentDate
.
getMonth
()
+
1
}
-
${
currentDate
.
getDate
()}
`
;
const
mockClosedAtYear
=
currentDate
.
getFullYear
()
-
1
;
const
createComponent
=
({
...
...
@@ -156,21 +158,11 @@ describe('RelatedItemsTree', () => {
});
it
(
'
renders path in bold
'
,
()
=>
{
expect
(
wrapper
.
find
({
ref
:
'
statePath
'
})
.
text
()
.
trim
(),
).
toBe
(
'
/foo/bar#1
'
);
expect
(
wrapper
.
find
({
ref
:
'
statePath
'
}).
text
().
trim
()).
toBe
(
'
/foo/bar#1
'
);
});
it
(
'
renders stateText in bold
'
,
()
=>
{
expect
(
wrapper
.
find
({
ref
:
'
stateText
'
})
.
text
()
.
trim
(),
).
toBe
(
'
Closed
'
);
expect
(
wrapper
.
find
({
ref
:
'
stateText
'
}).
text
().
trim
()).
toBe
(
'
Closed
'
);
});
it
(
'
renders stateTimeInWords
'
,
()
=>
{
...
...
@@ -178,12 +170,7 @@ describe('RelatedItemsTree', () => {
});
it
(
'
renders stateTimestamp in muted
'
,
()
=>
{
expect
(
wrapper
.
find
({
ref
:
'
stateTimestamp
'
})
.
text
()
.
trim
(),
).
toContain
(
mockClosedAtYear
);
expect
(
wrapper
.
find
({
ref
:
'
stateTimestamp
'
}).
text
().
trim
()).
toContain
(
mockClosedAtYear
);
});
});
});
...
...
ee/spec/frontend/related_items_tree/store/mutations_spec.js
View file @
8ac8a1f2
...
...
@@ -681,7 +681,10 @@ describe('RelatedItemsTree', () => {
describe
(
types
.
RECIEVE_PROJECTS_SUCCESS
,
()
=>
{
it
(
'
should set `projectsFetchInProgress` to false and provided `projects` param as it is within the state
'
,
()
=>
{
const
projects
=
[{
id
:
1
,
name
:
'
foo
'
},
{
id
:
2
,
name
:
'
bar
'
}];
const
projects
=
[
{
id
:
1
,
name
:
'
foo
'
},
{
id
:
2
,
name
:
'
bar
'
},
];
mutations
[
types
.
RECIEVE_PROJECTS_SUCCESS
](
state
,
projects
);
...
...
ee/spec/frontend/roadmap/components/epic_item_container_spec.js
View file @
8ac8a1f2
...
...
@@ -24,7 +24,7 @@ const createComponent = ({
children
=
[],
childLevel
=
0
,
childrenEpics
=
{},
childrenFlags
=
{
'
1
'
:
{
itemExpanded
:
false
}
},
childrenFlags
=
{
1
:
{
itemExpanded
:
false
}
},
hasFiltersApplied
=
false
,
}
=
{})
=>
{
return
mount
(
EpicItemContainer
,
{
...
...
@@ -66,8 +66,8 @@ describe('EpicItemContainer', () => {
wrapper
=
createComponent
({
children
:
[
mockFormattedChildEpic1
],
childrenFlags
:
{
'
1
'
:
{
itemExpanded
:
true
},
'
50
'
:
{
itemExpanded
:
false
},
1
:
{
itemExpanded
:
true
},
50
:
{
itemExpanded
:
false
},
},
});
expect
(
wrapper
.
find
(
EpicItem
).
exists
()).
toBe
(
true
);
...
...
ee/spec/frontend/roadmap/components/epic_item_details_spec.js
View file @
8ac8a1f2
...
...
@@ -31,7 +31,7 @@ describe('EpicItemDetails', () => {
currentGroupId
:
mockGroupId
,
timeframeString
:
'
Jul 10, 2017 – Jun 2, 2018
'
,
childLevel
:
0
,
childrenFlags
:
{
'
41
'
:
{
itemExpanded
:
false
}
},
childrenFlags
:
{
41
:
{
itemExpanded
:
false
}
},
hasFiltersApplied
:
false
,
isChildrenEmpty
:
false
,
...
props
,
...
...
@@ -203,7 +203,7 @@ describe('EpicItemDetails', () => {
describe
(
'
when child epics are expanded
'
,
()
=>
{
const
childrenFlags
=
{
'
41
'
:
{
itemExpanded
:
true
},
41
:
{
itemExpanded
:
true
},
};
beforeEach
(()
=>
{
...
...
@@ -241,7 +241,7 @@ describe('EpicItemDetails', () => {
describe
(
'
when child epics are not expanded
'
,
()
=>
{
beforeEach
(()
=>
{
const
childrenFlags
=
{
'
41
'
:
{
itemExpanded
:
false
},
41
:
{
itemExpanded
:
false
},
};
createWrapper
({
epic
,
...
...
ee/spec/frontend/roadmap/components/epic_item_spec.js
View file @
8ac8a1f2
...
...
@@ -35,7 +35,7 @@ const createComponent = ({
currentGroupId
=
mockGroupId
,
childLevel
=
0
,
childrenEpics
=
{},
childrenFlags
=
{
'
1
'
:
{
itemExpanded
:
false
}
},
childrenFlags
=
{
1
:
{
itemExpanded
:
false
}
},
hasFiltersApplied
=
false
,
})
=>
{
return
mount
(
EpicItemComponent
,
{
...
...
@@ -170,11 +170,11 @@ describe('EpicItemComponent', () => {
it
(
'
renders Epic item container element with class `epic-list-item-container` if epic has children and is expanded
'
,
()
=>
{
wrapper
=
createComponent
({
childrenEpics
:
{
'
1
'
:
[
mockFormattedChildEpic1
],
1
:
[
mockFormattedChildEpic1
],
},
childrenFlags
:
{
'
1
'
:
{
itemExpanded
:
true
},
'
50
'
:
{
itemExpanded
:
false
},
1
:
{
itemExpanded
:
true
},
50
:
{
itemExpanded
:
false
},
},
});
expect
(
wrapper
.
find
(
'
.epic-list-item-container
'
).
exists
()).
toBe
(
true
);
...
...
ee/spec/frontend/roadmap/components/milestones_list_section_spec.js
View file @
8ac8a1f2
...
...
@@ -172,9 +172,7 @@ describe('MilestonesListSectionComponent', () => {
describe
(
'
when the milestone list is expanded
'
,
()
=>
{
beforeEach
(()
=>
{
findExpandButtonContainer
()
.
find
(
GlButton
)
.
vm
.
$emit
(
'
click
'
);
findExpandButtonContainer
().
find
(
GlButton
).
vm
.
$emit
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
();
});
...
...
ee/spec/frontend/roadmap/components/roadmap_shell_spec.js
View file @
8ac8a1f2
...
...
@@ -27,7 +27,7 @@ describe('RoadmapShell', () => {
store
=
createStore
();
store
.
dispatch
(
'
setInitialData
'
,
{
defaultInnerHeight
,
childrenFlags
:
{
'
1
'
:
{
itemExpanded
:
false
}
},
childrenFlags
:
{
1
:
{
itemExpanded
:
false
}
},
});
};
...
...
ee/spec/frontend/security_configuration/components/auto_fix_settings_spec.js
View file @
8ac8a1f2
...
...
@@ -55,10 +55,7 @@ describe('Auto-fix Settings', () => {
const
findCheckbox
=
()
=>
wrapper
.
find
(
'
input[type="checkbox"]
'
);
const
findFooter
=
()
=>
wrapper
.
find
(
'
footer
'
);
const
findFooterLinks
=
()
=>
findFooter
().
findAll
(
'
a
'
);
const
getFooterTextContent
=
()
=>
findFooter
()
.
text
()
.
trim
();
const
getFooterTextContent
=
()
=>
findFooter
().
text
().
trim
();
const
expectCheckboxDisabled
=
()
=>
expect
(
findCheckbox
().
attributes
().
disabled
).
toBeTruthy
();
...
...
ee/spec/frontend/security_configuration/dast_scanner_profiles_form/components/dast_scanner_profiles_form_spec.js
View file @
8ac8a1f2
...
...
@@ -121,27 +121,19 @@ describe('DAST Scanner Profile', () => {
});
it
.
each
(
invalidValues
)(
'
is marked as invalid provided an invalid value
'
,
async
value
=>
{
await
finder
()
.
find
(
'
input
'
)
.
setValue
(
value
);
await
finder
().
find
(
'
input
'
).
setValue
(
value
);
expect
(
wrapper
.
text
()).
toContain
(
errorMessage
);
});
it
(
'
is marked as valid provided a valid value
'
,
async
()
=>
{
await
finder
()
.
find
(
'
input
'
)
.
setValue
(
validValue
);
await
finder
().
find
(
'
input
'
).
setValue
(
validValue
);
expect
(
wrapper
.
text
()).
not
.
toContain
(
errorMessage
);
});
it
(
'
should allow only numbers
'
,
async
()
=>
{
expect
(
finder
()
.
find
(
'
input
'
)
.
props
(
'
type
'
),
).
toBe
(
'
number
'
);
expect
(
finder
().
find
(
'
input
'
).
props
(
'
type
'
)).
toBe
(
'
number
'
);
});
});
...
...
ee/spec/frontend/security_configuration/sast/components/dynamic_fields_spec.js
View file @
8ac8a1f2
...
...
@@ -53,11 +53,7 @@ describe('DynamicFields component', () => {
it
(
'
passes the disabled prop to child fields
'
,
()
=>
{
entities
.
forEach
((
entity
,
i
)
=>
{
expect
(
findFields
()
.
at
(
i
)
.
props
(
'
disabled
'
),
).
toBe
(
disabled
);
expect
(
findFields
().
at
(
i
).
props
(
'
disabled
'
)).
toBe
(
disabled
);
});
});
});
...
...
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