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
ed189d0e
Commit
ed189d0e
authored
Dec 22, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 30 spec files: 2 of 10
Mandatory not to break master. Automatically created with prettier.
parent
6e183d50
Changes
31
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
115 additions
and
212 deletions
+115
-212
.prettierignore
.prettierignore
+0
-11
ee/spec/frontend/approvals/components/app_spec.js
ee/spec/frontend/approvals/components/app_spec.js
+3
-4
ee/spec/frontend/approvals/components/approval_check_popover_spec.js
...ntend/approvals/components/approval_check_popover_spec.js
+2
-12
ee/spec/frontend/approvals/components/branches_select_spec.js
...pec/frontend/approvals/components/branches_select_spec.js
+4
-1
ee/spec/frontend/approvals/components/license_compliance/modal_spec.js
...end/approvals/components/license_compliance/modal_spec.js
+1
-5
ee/spec/frontend/approvals/components/mr_edit/app_spec.js
ee/spec/frontend/approvals/components/mr_edit/app_spec.js
+2
-12
ee/spec/frontend/approvals/components/mr_edit/mr_rules_spec.js
...ec/frontend/approvals/components/mr_edit/mr_rules_spec.js
+1
-5
ee/spec/frontend/audit_events/components/audit_events_table_spec.js
...ontend/audit_events/components/audit_events_table_spec.js
+1
-7
ee/spec/frontend/audit_events/components/date_range_buttons_spec.js
...ontend/audit_events/components/date_range_buttons_spec.js
+3
-16
ee/spec/frontend/audit_events/components/date_range_field_spec.js
...frontend/audit_events/components/date_range_field_spec.js
+9
-15
ee/spec/frontend/audit_events/components/sorting_field_spec.js
...ec/frontend/audit_events/components/sorting_field_spec.js
+2
-9
ee/spec/frontend/billings/subscriptions/components/subscription_table_row_spec.js
...s/subscriptions/components/subscription_table_row_spec.js
+1
-4
ee/spec/frontend/boards/components/board_content_sidebar_spec.js
.../frontend/boards/components/board_content_sidebar_spec.js
+1
-1
ee/spec/frontend/boards/components/epics_swimlanes_spec.js
ee/spec/frontend/boards/components/epics_swimlanes_spec.js
+4
-10
ee/spec/frontend/boards/components/sidebar/board_sidebar_time_tracker_spec.js
...rds/components/sidebar/board_sidebar_time_tracker_spec.js
+1
-1
ee/spec/frontend/boards/components/weight_select_spec.js
ee/spec/frontend/boards/components/weight_select_spec.js
+1
-4
ee/spec/frontend/boards/stores/actions_spec.js
ee/spec/frontend/boards/stores/actions_spec.js
+7
-6
ee/spec/frontend/boards/stores/mutations_spec.js
ee/spec/frontend/boards/stores/mutations_spec.js
+4
-4
ee/spec/frontend/burndown_chart/burn_chart_data_spec.js
ee/spec/frontend/burndown_chart/burn_chart_data_spec.js
+25
-5
ee/spec/frontend/burndown_chart/components/burn_charts_spec.js
...ec/frontend/burndown_chart/components/burn_charts_spec.js
+2
-10
ee/spec/frontend/burndown_chart/components/timebox_summary_cards_spec.js
...d/burndown_chart/components/timebox_summary_cards_spec.js
+3
-15
ee/spec/frontend/compliance_dashboard/components/merge_requests/merge_request_spec.js
...dashboard/components/merge_requests/merge_request_spec.js
+1
-5
ee/spec/frontend/dependencies/components/dependencies_table_spec.js
...ontend/dependencies/components/dependencies_table_spec.js
+1
-3
ee/spec/frontend/epic/store/actions_spec.js
ee/spec/frontend/epic/store/actions_spec.js
+8
-2
ee/spec/frontend/epic/store/mutations_spec.js
ee/spec/frontend/epic/store/mutations_spec.js
+16
-4
ee/spec/frontend/geo_nodes/components/geo_node_actions_spec.js
...ec/frontend/geo_nodes/components/geo_node_actions_spec.js
+1
-5
ee/spec/frontend/geo_nodes/components/geo_node_detail_item_spec.js
...rontend/geo_nodes/components/geo_node_detail_item_spec.js
+5
-18
ee/spec/frontend/geo_nodes/components/geo_node_health_status_spec.js
...ntend/geo_nodes/components/geo_node_health_status_spec.js
+1
-5
ee/spec/frontend/geo_nodes/components/geo_node_replication_status_spec.js
.../geo_nodes/components/geo_node_replication_status_spec.js
+1
-5
ee/spec/frontend/geo_nodes/components/node_detail_sections/node_details_section_verification_spec.js
...detail_sections/node_details_section_verification_spec.js
+3
-5
ee/spec/frontend/geo_replicable/components/geo_replicable_filter_bar_spec.js
...o_replicable/components/geo_replicable_filter_bar_spec.js
+1
-3
No files found.
.prettierignore
View file @
ed189d0e
...
...
@@ -11,17 +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/approvals/components
ee/spec/frontend/audit_events/components
ee/spec/frontend/billings/subscriptions/components
ee/spec/frontend/boards/components
ee/spec/frontend/boards/stores
ee/spec/frontend/burndown_chart
ee/spec/frontend/compliance_dashboard/components/merge_requests
ee/spec/frontend/dependencies/components
ee/spec/frontend/epic/store
ee/spec/frontend/geo_nodes/components
ee/spec/frontend/geo_replicable/components
ee/spec/frontend/groups/components
ee/spec/frontend/groups/settings/
ee/spec/frontend/incidents/components
...
...
ee/spec/frontend/approvals/components/app_spec.js
View file @
ed189d0e
...
...
@@ -216,10 +216,9 @@ describe('EE Approvals App', () => {
findResetButton
().
vm
.
$emit
(
'
click
'
);
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
store
.
modules
.
approvals
.
actions
.
fetchRules
).
toHaveBeenLastCalledWith
(
expect
.
anything
(),
{
targetBranch
,
resetToDefault
:
true
},
);
expect
(
store
.
modules
.
approvals
.
actions
.
fetchRules
,
).
toHaveBeenLastCalledWith
(
expect
.
anything
(),
{
targetBranch
,
resetToDefault
:
true
});
expect
(
showToast
).
toHaveBeenCalledWith
(
'
Approval rules reset to project defaults
'
,
{
action
:
{
text
:
'
Undo
'
,
...
...
ee/spec/frontend/approvals/components/approval_check_popover_spec.js
View file @
ed189d0e
...
...
@@ -25,23 +25,13 @@ describe('Approval Check Popover', () => {
});
it
(
'
should render the documentation link
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlPopover
)
.
find
(
GlLink
)
.
attributes
(
'
href
'
),
).
toBe
(
documentationLink
);
expect
(
wrapper
.
find
(
GlPopover
).
find
(
GlLink
).
attributes
(
'
href
'
)).
toBe
(
documentationLink
);
});
});
describe
(
'
without a documentation link
'
,
()
=>
{
it
(
'
should not render the documentation link
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlPopover
)
.
find
(
GlLink
)
.
exists
(),
).
toBeFalsy
();
expect
(
wrapper
.
find
(
GlPopover
).
find
(
GlLink
).
exists
()).
toBeFalsy
();
});
});
});
ee/spec/frontend/approvals/components/branches_select_spec.js
View file @
ed189d0e
...
...
@@ -7,7 +7,10 @@ import BranchesSelect from 'ee/approvals/components/branches_select.vue';
const
TEST_DEFAULT_BRANCH
=
{
name
:
'
Any branch
'
};
const
TEST_PROJECT_ID
=
'
1
'
;
const
TEST_PROTECTED_BRANCHES
=
[{
id
:
1
,
name
:
'
master
'
},
{
id
:
2
,
name
:
'
development
'
}];
const
TEST_PROTECTED_BRANCHES
=
[
{
id
:
1
,
name
:
'
master
'
},
{
id
:
2
,
name
:
'
development
'
},
];
const
TEST_BRANCHES_SELECTIONS
=
[
TEST_DEFAULT_BRANCH
,
...
TEST_PROTECTED_BRANCHES
];
const
waitForEvent
=
(
$input
,
event
)
=>
new
Promise
(
resolve
=>
$input
.
one
(
event
,
resolve
));
const
select2Container
=
()
=>
document
.
querySelector
(
'
.select2-container
'
);
...
...
ee/spec/frontend/approvals/components/license_compliance/modal_spec.js
View file @
ed189d0e
...
...
@@ -89,11 +89,7 @@ describe('EE Approvals LicenseCompliance Modal', () => {
createWrapper
();
expect
(
findModal
()
.
attributes
(
'
title
'
)
.
startsWith
(
expectTitleStartsWith
),
).
toBe
(
true
);
expect
(
findModal
().
attributes
(
'
title
'
).
startsWith
(
expectTitleStartsWith
)).
toBe
(
true
);
});
});
...
...
ee/spec/frontend/approvals/components/mr_edit/app_spec.js
View file @
ed189d0e
...
...
@@ -53,12 +53,7 @@ describe('EE Approvals MREditApp', () => {
});
it
(
'
renders hidden inputs
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.js-approval-rules
'
)
.
find
(
MRRulesHiddenInputs
)
.
exists
(),
).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
.js-approval-rules
'
).
find
(
MRRulesHiddenInputs
).
exists
()).
toBe
(
true
);
});
});
...
...
@@ -76,12 +71,7 @@ describe('EE Approvals MREditApp', () => {
store
.
modules
.
approvals
.
state
.
rules
=
[{
id
:
7
,
approvers
:
[]
}];
factory
();
expect
(
wrapper
.
find
(
'
.js-approval-rules
'
)
.
find
(
MRRulesHiddenInputs
)
.
exists
(),
).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
.js-approval-rules
'
).
find
(
MRRulesHiddenInputs
).
exists
()).
toBe
(
true
);
});
describe
(
'
summary text
'
,
()
=>
{
...
...
ee/spec/frontend/approvals/components/mr_edit/mr_rules_spec.js
View file @
ed189d0e
...
...
@@ -34,11 +34,7 @@ describe('EE Approvals MRRules', () => {
const
findHeaders
=
()
=>
wrapper
.
findAll
(
'
thead th
'
).
wrappers
.
map
(
x
=>
x
.
text
());
const
findRuleName
=
()
=>
wrapper
.
find
(
'
.js-name
'
);
const
findRuleIndicator
=
()
=>
wrapper
.
find
({
ref
:
'
indicator
'
});
const
findRuleMembers
=
()
=>
wrapper
.
find
(
'
td.js-members
'
)
.
find
(
UserAvatarList
)
.
props
(
'
items
'
);
const
findRuleMembers
=
()
=>
wrapper
.
find
(
'
td.js-members
'
).
find
(
UserAvatarList
).
props
(
'
items
'
);
const
findRuleControls
=
()
=>
wrapper
.
find
(
'
td.js-controls
'
).
find
(
RuleControls
);
const
callTargetBranchHandler
=
MutationObserverSpy
=>
{
const
onTargetBranchMutationHandler
=
MutationObserverSpy
.
mock
.
calls
[
0
][
0
];
...
...
ee/spec/frontend/audit_events/components/audit_events_table_spec.js
View file @
ed189d0e
...
...
@@ -20,13 +20,7 @@ describe('AuditEventsTable component', () => {
};
const
getCell
=
(
trIdx
,
tdIdx
)
=>
{
return
wrapper
.
find
(
GlTable
)
.
find
(
'
tbody
'
)
.
findAll
(
'
tr
'
)
.
at
(
trIdx
)
.
findAll
(
'
td
'
)
.
at
(
tdIdx
);
return
wrapper
.
find
(
GlTable
).
find
(
'
tbody
'
).
findAll
(
'
tr
'
).
at
(
trIdx
).
findAll
(
'
td
'
).
at
(
tdIdx
);
};
beforeEach
(()
=>
{
...
...
ee/spec/frontend/audit_events/components/date_range_buttons_spec.js
View file @
ed189d0e
...
...
@@ -24,12 +24,7 @@ describe('DateRangeButtons component', () => {
dateRange
:
{
startDate
:
getDateInPast
(
CURRENT_DATE
,
7
),
endDate
:
CURRENT_DATE
},
});
expect
(
wrapper
.
find
(
GlButtonGroup
)
.
find
(
'
[selected="true"]
'
)
.
text
(),
).
toBe
(
'
Last 7 days
'
);
expect
(
wrapper
.
find
(
GlButtonGroup
).
find
(
'
[selected="true"]
'
).
text
()).
toBe
(
'
Last 7 days
'
);
});
it
(
'
shows no date range as selected when the dateRange property does not match any option
'
,
()
=>
{
...
...
@@ -40,22 +35,14 @@ describe('DateRangeButtons component', () => {
},
});
expect
(
wrapper
.
find
(
GlButtonGroup
)
.
find
(
'
[selected="true"]
'
)
.
exists
(),
).
toBe
(
false
);
expect
(
wrapper
.
find
(
GlButtonGroup
).
find
(
'
[selected="true"]
'
).
exists
()).
toBe
(
false
);
});
it
(
'
emits an "input" event with the dateRange when a new date range is selected
'
,
async
()
=>
{
createComponent
({
dateRange
:
{
startDate
:
getDateInPast
(
CURRENT_DATE
,
1
),
endDate
:
CURRENT_DATE
},
});
wrapper
.
find
(
GlButtonGroup
)
.
find
(
GlButton
)
.
vm
.
$emit
(
'
click
'
);
wrapper
.
find
(
GlButtonGroup
).
find
(
GlButton
).
vm
.
$emit
(
'
click
'
);
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
emitted
().
input
[
0
]).
toEqual
([
...
...
ee/spec/frontend/audit_events/components/date_range_field_spec.js
View file @
ed189d0e
...
...
@@ -40,31 +40,25 @@ describe('DateRangeField component', () => {
it
(
"
sets the max selectable date to today's date on the date picker
"
,
()
=>
{
createComponent
();
expect
(
findDatePicker
()
.
props
(
'
defaultMaxDate
'
)
.
toDateString
(),
).
toBe
(
CURRENT_DATE
.
toDateString
());
expect
(
findDatePicker
().
props
(
'
defaultMaxDate
'
).
toDateString
()).
toBe
(
CURRENT_DATE
.
toDateString
(),
);
});
it
(
'
sets the default start date to the start of the month
'
,
()
=>
{
createComponent
();
expect
(
findDatePicker
()
.
props
(
'
defaultStartDate
'
)
.
toDateString
(),
).
toBe
(
dateAtFirstDayOfMonth
(
CURRENT_DATE
).
toDateString
());
expect
(
findDatePicker
().
props
(
'
defaultStartDate
'
).
toDateString
()).
toBe
(
dateAtFirstDayOfMonth
(
CURRENT_DATE
).
toDateString
(),
);
});
it
(
"
sets the default end date to today's date
"
,
()
=>
{
createComponent
();
expect
(
findDatePicker
()
.
props
(
'
defaultEndDate
'
)
.
toDateString
(),
).
toBe
(
CURRENT_DATE
.
toDateString
());
expect
(
findDatePicker
().
props
(
'
defaultEndDate
'
).
toDateString
()).
toBe
(
CURRENT_DATE
.
toDateString
(),
);
});
it
(
'
passes both startDate and endDate to the date picker as default dates
'
,
()
=>
{
...
...
ee/spec/frontend/audit_events/components/sorting_field_spec.js
View file @
ed189d0e
...
...
@@ -41,11 +41,7 @@ describe('SortingField component', () => {
it
(
'
should set the sorting option accordingly
'
,
()
=>
{
expect
(
getCheckedOptions
()).
toHaveLength
(
1
);
expect
(
getCheckedOptions
()
.
at
(
0
)
.
text
(),
).
toEqual
(
'
Oldest created
'
);
expect
(
getCheckedOptions
().
at
(
0
).
text
()).
toEqual
(
'
Oldest created
'
);
});
});
});
...
...
@@ -53,10 +49,7 @@ describe('SortingField component', () => {
describe
(
'
when the user clicks on a option
'
,
()
=>
{
beforeEach
(()
=>
{
initComponent
();
wrapper
.
findAll
(
GlDropdownItem
)
.
at
(
1
)
.
vm
.
$emit
(
'
click
'
);
wrapper
.
findAll
(
GlDropdownItem
).
at
(
1
).
vm
.
$emit
(
'
click
'
);
});
it
(
'
should emit the "selected" event with clicked option
'
,
()
=>
{
...
...
ee/spec/frontend/billings/subscriptions/components/subscription_table_row_spec.js
View file @
ed189d0e
...
...
@@ -86,10 +86,7 @@ describe('subscription table row', () => {
});
};
const
findUsageButton
=
()
=>
findContentCells
()
.
at
(
0
)
.
find
(
'
[data-testid="seats-usage-button"]
'
);
const
findUsageButton
=
()
=>
findContentCells
().
at
(
0
).
find
(
'
[data-testid="seats-usage-button"]
'
);
describe
(
'
dispatched actions
'
,
()
=>
{
it
(
'
dispatches action when created if namespace is group
'
,
()
=>
{
...
...
ee/spec/frontend/boards/components/board_content_sidebar_spec.js
View file @
ed189d0e
...
...
@@ -42,7 +42,7 @@ describe('ee/BoardContentSidebar', () => {
beforeEach
(()
=>
{
store
=
createStore
();
store
.
state
.
sidebarType
=
ISSUABLE
;
store
.
state
.
issues
=
{
'
1
'
:
{
title
:
'
One
'
,
referencePath
:
'
path
'
,
assignees
:
[]
}
};
store
.
state
.
issues
=
{
1
:
{
title
:
'
One
'
,
referencePath
:
'
path
'
,
assignees
:
[]
}
};
store
.
state
.
activeId
=
'
1
'
;
createComponent
();
...
...
ee/spec/frontend/boards/components/epics_swimlanes_spec.js
View file @
ed189d0e
...
...
@@ -103,20 +103,14 @@ describe('EpicsSwimlanes', () => {
});
it
(
'
makes non preset lists draggable
'
,
()
=>
{
expect
(
wrapper
.
findAll
(
'
[data-testid="board-header-container"]
'
)
.
at
(
1
)
.
classes
(),
).
toContain
(
'
is-draggable
'
);
expect
(
wrapper
.
findAll
(
'
[data-testid="board-header-container"]
'
).
at
(
1
).
classes
()).
toContain
(
'
is-draggable
'
,
);
});
it
(
'
does not make preset lists draggable
'
,
()
=>
{
expect
(
wrapper
.
findAll
(
'
[data-testid="board-header-container"]
'
)
.
at
(
0
)
.
classes
(),
wrapper
.
findAll
(
'
[data-testid="board-header-container"]
'
).
at
(
0
).
classes
(),
).
not
.
toContain
(
'
is-draggable
'
);
});
});
...
...
ee/spec/frontend/boards/components/sidebar/board_sidebar_time_tracker_spec.js
View file @
ed189d0e
...
...
@@ -25,7 +25,7 @@ describe('BoardSidebarTimeTracker', () => {
beforeEach
(()
=>
{
store
=
createStore
();
store
.
state
.
issues
=
{
'
1
'
:
{
1
:
{
timeEstimate
:
3600
,
totalTimeSpent
:
1800
,
humanTimeEstimate
:
'
1h
'
,
...
...
ee/spec/frontend/boards/components/weight_select_spec.js
View file @
ed189d0e
...
...
@@ -8,10 +8,7 @@ describe('WeightSelect', () => {
const
editButton
=
()
=>
wrapper
.
find
(
GlButton
);
const
valueContainer
=
()
=>
wrapper
.
find
(
'
.value
'
);
const
weightDropdown
=
()
=>
wrapper
.
find
(
GlDropdown
);
const
getWeightItemAtIndex
=
index
=>
weightDropdown
()
.
findAll
(
GlDropdownItem
)
.
at
(
index
);
const
getWeightItemAtIndex
=
index
=>
weightDropdown
().
findAll
(
GlDropdownItem
).
at
(
index
);
const
defaultProps
=
{
weights
:
[
'
Any
'
,
'
None
'
,
0
,
1
,
2
,
3
],
board
:
{
...
...
ee/spec/frontend/boards/stores/actions_spec.js
View file @
ed189d0e
...
...
@@ -310,10 +310,11 @@ describe('updateListWipLimit', () => {
return
actions
.
updateListWipLimit
({
state
:
{
activeId
},
getters
},
{
maxIssueCount
,
listId
:
activeId
})
.
then
(()
=>
{
expect
(
axios
.
put
).
toHaveBeenCalledWith
(
`
${
boardsStoreEE
.
store
.
state
.
endpoints
.
listsEndpoint
}
/
${
activeId
}
`
,
{
list
:
{
max_issue_count
:
maxIssueCount
}
},
);
expect
(
axios
.
put
,
).
toHaveBeenCalledWith
(
`
${
boardsStoreEE
.
store
.
state
.
endpoints
.
listsEndpoint
}
/
${
activeId
}
`
,
{
list
:
{
max_issue_count
:
maxIssueCount
},
});
});
});
...
...
@@ -620,8 +621,8 @@ describe('moveIssue', () => {
};
const
issues
=
{
'
436
'
:
mockIssue
,
'
437
'
:
mockIssue2
,
436
:
mockIssue
,
437
:
mockIssue2
,
};
const
state
=
{
...
...
ee/spec/frontend/boards/stores/mutations_spec.js
View file @
ed189d0e
...
...
@@ -98,8 +98,8 @@ describe('RECEIVE_ISSUES_FOR_EPIC_SUCCESS', () => {
'
gid://gitlab/List/2
'
:
[
mockIssue2
.
id
],
};
const
issues
=
{
'
436
'
:
mockIssue
,
'
437
'
:
mockIssue2
,
436
:
mockIssue
,
437
:
mockIssue2
,
};
mutations
.
RECEIVE_ISSUES_FOR_EPIC_SUCCESS
(
state
,
{
...
...
@@ -265,8 +265,8 @@ describe('MOVE_ISSUE', () => {
};
const
issues
=
{
'
436
'
:
mockIssue
,
'
437
'
:
mockIssue2
,
436
:
mockIssue
,
437
:
mockIssue2
,
};
state
=
{
...
...
ee/spec/frontend/burndown_chart/burn_chart_data_spec.js
View file @
ed189d0e
...
...
@@ -232,7 +232,11 @@ describe('BurndownChartData', () => {
it
(
'
generates an array of arrays with date and issue count
'
,
()
=>
{
const
{
burnupScope
}
=
burndownChartData
().
generateBurnupTimeseries
({
milestoneId
});
expect
(
burnupScope
).
toEqual
([[
'
2017-03-01
'
,
2
],
[
'
2017-03-02
'
,
1
],
[
'
2017-03-03
'
,
0
]]);
expect
(
burnupScope
).
toEqual
([
[
'
2017-03-01
'
,
2
],
[
'
2017-03-02
'
,
1
],
[
'
2017-03-03
'
,
0
],
]);
});
it
(
'
starts from 0
'
,
()
=>
{
...
...
@@ -265,7 +269,11 @@ describe('BurndownChartData', () => {
milestoneId
,
});
expect
(
burnupScope
).
toEqual
([[
'
2017-03-01
'
,
0
],
[
'
2017-03-02
'
,
0
],
[
'
2017-03-03
'
,
0
]]);
expect
(
burnupScope
).
toEqual
([
[
'
2017-03-01
'
,
0
],
[
'
2017-03-02
'
,
0
],
[
'
2017-03-03
'
,
0
],
]);
});
it
(
'
ignores removed from other milestones
'
,
()
=>
{
...
...
@@ -289,7 +297,11 @@ describe('BurndownChartData', () => {
const
{
burnupScope
}
=
burndownChartData
(
events
).
generateBurnupTimeseries
({
milestoneId
});
expect
(
burnupScope
).
toEqual
([[
'
2017-03-01
'
,
1
],
[
'
2017-03-02
'
,
1
],
[
'
2017-03-03
'
,
1
]]);
expect
(
burnupScope
).
toEqual
([
[
'
2017-03-01
'
,
1
],
[
'
2017-03-02
'
,
1
],
[
'
2017-03-03
'
,
1
],
]);
});
it
(
'
only adds milestone event_type
'
,
()
=>
{
...
...
@@ -314,7 +326,11 @@ describe('BurndownChartData', () => {
const
{
burnupScope
}
=
burndownChartData
(
events
).
generateBurnupTimeseries
({
milestoneId
});
expect
(
burnupScope
).
toEqual
([[
'
2017-03-01
'
,
0
],
[
'
2017-03-02
'
,
1
],
[
'
2017-03-03
'
,
1
]]);
expect
(
burnupScope
).
toEqual
([
[
'
2017-03-01
'
,
0
],
[
'
2017-03-02
'
,
1
],
[
'
2017-03-03
'
,
1
],
]);
});
it
(
'
only removes milestone event_type
'
,
()
=>
{
...
...
@@ -345,7 +361,11 @@ describe('BurndownChartData', () => {
const
{
burnupScope
}
=
burndownChartData
(
events
).
generateBurnupTimeseries
({
milestoneId
});
expect
(
burnupScope
).
toEqual
([[
'
2017-03-01
'
,
1
],
[
'
2017-03-02
'
,
1
],
[
'
2017-03-03
'
,
0
]]);
expect
(
burnupScope
).
toEqual
([
[
'
2017-03-01
'
,
1
],
[
'
2017-03-02
'
,
1
],
[
'
2017-03-03
'
,
0
],
]);
});
});
});
ee/spec/frontend/burndown_chart/components/burn_charts_spec.js
View file @
ed189d0e
...
...
@@ -80,11 +80,7 @@ describe('burndown_chart', () => {
createComponent
();
expect
(
findActiveButtons
()).
toHaveLength
(
1
);
expect
(
findActiveButtons
()
.
at
(
0
)
.
text
(),
).
toBe
(
'
Issues
'
);
expect
(
findActiveButtons
().
at
(
0
).
text
()).
toBe
(
'
Issues
'
);
expect
(
findBurndownChart
().
props
(
'
issuesSelected
'
)).
toBe
(
true
);
});
...
...
@@ -96,11 +92,7 @@ describe('burndown_chart', () => {
await
wrapper
.
vm
.
$nextTick
();
expect
(
findActiveButtons
()).
toHaveLength
(
1
);
expect
(
findActiveButtons
()
.
at
(
0
)
.
text
(),
).
toBe
(
'
Issue weight
'
);
expect
(
findActiveButtons
().
at
(
0
).
text
()).
toBe
(
'
Issue weight
'
);
expect
(
findBurndownChart
().
props
(
'
issuesSelected
'
)).
toBe
(
false
);
});
...
...
ee/spec/frontend/burndown_chart/components/timebox_summary_cards_spec.js
View file @
ed189d0e
...
...
@@ -34,21 +34,9 @@ describe('Iterations report summary cards', () => {
wrapper
=
null
;
});
const
findCompleteCard
=
()
=>
wrapper
.
findAll
(
GlCard
)
.
at
(
0
)
.
text
();
const
findIncompleteCard
=
()
=>
wrapper
.
findAll
(
GlCard
)
.
at
(
1
)
.
text
();
const
findUnstartedCard
=
()
=>
wrapper
.
findAll
(
GlCard
)
.
at
(
2
)
.
text
();
const
findCompleteCard
=
()
=>
wrapper
.
findAll
(
GlCard
).
at
(
0
).
text
();
const
findIncompleteCard
=
()
=>
wrapper
.
findAll
(
GlCard
).
at
(
1
).
text
();
const
findUnstartedCard
=
()
=>
wrapper
.
findAll
(
GlCard
).
at
(
2
).
text
();
describe
(
'
with valid totals
'
,
()
=>
{
beforeEach
(()
=>
{
...
...
ee/spec/frontend/compliance_dashboard/components/merge_requests/merge_request_spec.js
View file @
ed189d0e
...
...
@@ -47,11 +47,7 @@ describe('MergeRequest component', () => {
});
it
(
'
renders the author avatar
'
,
()
=>
{
expect
(
findAuthorAvatarLink
()
.
find
(
GlAvatar
)
.
exists
(),
).
toEqual
(
true
);
expect
(
findAuthorAvatarLink
().
find
(
GlAvatar
).
exists
()).
toEqual
(
true
);
});
it
(
'
renders the author name
'
,
()
=>
{
...
...
ee/spec/frontend/dependencies/components/dependencies_table_spec.js
View file @
ed189d0e
...
...
@@ -204,9 +204,7 @@ describe('DependenciesTable component', () => {
});
it('can be displayed by clicking on the vulnerabilities badge', () => {
const badge = findTableRows()
.at(rowIndexWithVulnerabilities)
.find(GlBadge);
const badge = findTableRows().at(rowIndexWithVulnerabilities).find(GlBadge);
badge.trigger('click');
return nextTick().then(() => {
...
...
ee/spec/frontend/epic/store/actions_spec.js
View file @
ed189d0e
...
...
@@ -816,7 +816,10 @@ describe('Epic Store Actions', () => {
describe
(
'
receiveEpicLabelsSelectSuccess
'
,
()
=>
{
it
(
'
should set provided labels param to `state.labels`
'
,
done
=>
{
const
labels
=
[{
id
:
1
,
set
:
false
},
{
id
:
2
,
set
:
true
}];
const
labels
=
[
{
id
:
1
,
set
:
false
},
{
id
:
2
,
set
:
true
},
];
testAction
(
actions
.
receiveEpicLabelsSelectSuccess
,
...
...
@@ -865,7 +868,10 @@ describe('Epic Store Actions', () => {
});
describe
(
'
updateEpicLabels
'
,
()
=>
{
const
labels
=
[{
id
:
1
,
set
:
false
},
{
id
:
2
,
set
:
true
}];
const
labels
=
[
{
id
:
1
,
set
:
false
},
{
id
:
2
,
set
:
true
},
];
it
(
'
dispatches `requestEpicLabelsSelect` and `receiveEpicLabelsSelectSuccess` actions when request succeeds
'
,
done
=>
{
jest
.
spyOn
(
epicUtils
.
gqClient
,
'
mutate
'
).
mockReturnValue
(
...
...
ee/spec/frontend/epic/store/mutations_spec.js
View file @
ed189d0e
...
...
@@ -371,7 +371,10 @@ describe('Epic Store Mutations', () => {
describe
(
'
RECEIVE_EPIC_LABELS_SELECT_SUCCESS
'
,
()
=>
{
it
(
'
Should update `labels` array on state when new labels are added
'
,
()
=>
{
const
addedLabels
=
[{
id
:
1
,
set
:
true
},
{
id
:
2
,
set
:
true
}];
const
addedLabels
=
[
{
id
:
1
,
set
:
true
},
{
id
:
2
,
set
:
true
},
];
const
state
=
{
labels
:
[],
};
...
...
@@ -384,7 +387,10 @@ describe('Epic Store Mutations', () => {
it
(
'
Should update `labels` array on state when existing labels are removed
'
,
()
=>
{
const
removedLabels
=
[{
id
:
1
,
set
:
false
}];
const
state
=
{
labels
:
[{
id
:
1
,
set
:
true
},
{
id
:
2
,
set
:
true
}],
labels
:
[
{
id
:
1
,
set
:
true
},
{
id
:
2
,
set
:
true
},
],
};
mutations
[
types
.
RECEIVE_EPIC_LABELS_SELECT_SUCCESS
](
state
,
removedLabels
);
...
...
@@ -396,7 +402,10 @@ describe('Epic Store Mutations', () => {
const
removedLabels
=
[{
id
:
1
,
set
:
false
}];
const
addedLabels
=
[{
id
:
3
,
set
:
true
}];
const
state
=
{
labels
:
[{
id
:
1
,
set
:
true
},
{
id
:
2
,
set
:
true
}],
labels
:
[
{
id
:
1
,
set
:
true
},
{
id
:
2
,
set
:
true
},
],
};
mutations
[
types
.
RECEIVE_EPIC_LABELS_SELECT_SUCCESS
](
state
,
[
...
...
@@ -405,7 +414,10 @@ describe('Epic Store Mutations', () => {
]);
expect
(
state
.
labels
).
toEqual
(
expect
.
arrayContaining
([{
id
:
2
,
set
:
true
},
{
id
:
3
,
set
:
true
}]),
expect
.
arrayContaining
([
{
id
:
2
,
set
:
true
},
{
id
:
3
,
set
:
true
},
]),
);
});
});
...
...
ee/spec/frontend/geo_nodes/components/geo_node_actions_spec.js
View file @
ed189d0e
...
...
@@ -122,11 +122,7 @@ describe('GeoNodeActionsComponent', () => {
describe
(
`when nodeRemovalAllowed is
${
nodeRemovalAllowed
}
`
,
()
=>
{
it
(
'
has the correct button text
'
,
()
=>
{
expect
(
findRemoveButton
()
.
text
()
.
trim
(),
).
toBe
(
'
Remove
'
);
expect
(
findRemoveButton
().
text
().
trim
()).
toBe
(
'
Remove
'
);
});
it
(
`the button's disabled attribute should be
${
buttonDisabled
}
`
,
()
=>
{
...
...
ee/spec/frontend/geo_nodes/components/geo_node_detail_item_spec.js
View file @
ed189d0e
...
...
@@ -44,23 +44,13 @@ describe('GeoNodeDetailItemComponent', () => {
it
(
'
renders container elements correctly
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.node-detail-item
'
).
exists
()).
toBeTruthy
();
expect
(
wrapper
.
findAll
(
'
.node-detail-title
'
)).
not
.
toHaveLength
(
0
);
expect
(
wrapper
.
find
(
'
.node-detail-title
'
)
.
text
()
.
trim
(),
).
toBe
(
'
GitLab version
'
);
expect
(
wrapper
.
find
(
'
.node-detail-title
'
).
text
().
trim
()).
toBe
(
'
GitLab version
'
);
});
describe
(
'
when plain text value
'
,
()
=>
{
it
(
'
renders plain item value
'
,
()
=>
{
expect
(
wrapper
.
findAll
(
'
.node-detail-value
'
)).
not
.
toHaveLength
(
0
);
expect
(
wrapper
.
find
(
'
.node-detail-value
'
)
.
text
()
.
trim
(),
).
toBe
(
'
10.4.0-pre
'
);
expect
(
wrapper
.
find
(
'
.node-detail-value
'
).
text
().
trim
()).
toBe
(
'
10.4.0-pre
'
);
});
it
(
'
does not render graph item
'
,
()
=>
{
...
...
@@ -140,12 +130,9 @@ describe('GeoNodeDetailItemComponent', () => {
});
it
(
'
renders synchronization disabled text
'
,
()
=>
{
expect
(
wrapper
.
find
({
ref
:
'
disabledText
'
})
.
text
()
.
trim
(),
).
toBe
(
'
Synchronization disabled
'
);
expect
(
wrapper
.
find
({
ref
:
'
disabledText
'
}).
text
().
trim
()).
toBe
(
'
Synchronization disabled
'
,
);
});
it
(
'
renders GlPopover
'
,
()
=>
{
...
...
ee/spec/frontend/geo_nodes/components/geo_node_health_status_spec.js
View file @
ed189d0e
...
...
@@ -42,11 +42,7 @@ describe('GeoNodeHealthStatusComponent', () => {
});
it
(
`sets background of StatusPill to
${
healthCssClass
}
when status is
${
status
}
`
,
()
=>
{
expect
(
findStatusPill
()
.
classes
()
.
join
(
'
'
),
).
toContain
(
healthCssClass
);
expect
(
findStatusPill
().
classes
().
join
(
'
'
)).
toContain
(
healthCssClass
);
});
it
(
'
renders StatusPill correctly
'
,
()
=>
{
...
...
ee/spec/frontend/geo_nodes/components/geo_node_replication_status_spec.js
View file @
ed189d0e
...
...
@@ -56,11 +56,7 @@ describe('GeoNodeReplicationStatusComponent', () => {
});
it
(
`sets background of StatusPill to
${
replicationStatusCssClass
}
when enabled is
${
enabled
}
`
,
()
=>
{
expect
(
findStatusPill
()
.
classes
()
.
join
(
'
'
),
).
toContain
(
replicationStatusCssClass
);
expect
(
findStatusPill
().
classes
().
join
(
'
'
)).
toContain
(
replicationStatusCssClass
);
});
it
(
'
renders StatusPill correctly
'
,
()
=>
{
...
...
ee/spec/frontend/geo_nodes/components/node_detail_sections/node_details_section_verification_spec.js
View file @
ed189d0e
...
...
@@ -134,11 +134,9 @@ describe('NodeDetailsSectionVerification', () => {
});
it
(
'
contains text about Replicated data
'
,
()
=>
{
expect
(
findGlPopover
()
.
find
(
GlSprintf
)
.
attributes
(
'
message
'
),
).
toContain
(
'
Replicated data is verified
'
);
expect
(
findGlPopover
().
find
(
GlSprintf
).
attributes
(
'
message
'
)).
toContain
(
'
Replicated data is verified
'
,
);
});
});
...
...
ee/spec/frontend/geo_replicable/components/geo_replicable_filter_bar_spec.js
View file @
ed189d0e
...
...
@@ -69,9 +69,7 @@ describe('GeoReplicableFilterBar', () => {
it
(
'
clicking a dropdown item calls setFilter with its index
'
,
()
=>
{
const
index
=
1
;
findGlDropdownItems
()
.
at
(
index
)
.
vm
.
$emit
(
'
click
'
);
findGlDropdownItems
().
at
(
index
).
vm
.
$emit
(
'
click
'
);
expect
(
actionSpies
.
setFilter
).
toHaveBeenCalledWith
(
expect
.
any
(
Object
),
index
);
});
...
...
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