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
7f4e951c
Commit
7f4e951c
authored
Dec 23, 2020
by
Lukas Eipert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run prettier on 31 files - 45 of 73
Part of our prettier migration; changing the arrow-parens style.
parent
7dae714f
Changes
32
Hide whitespace changes
Inline
Side-by-side
Showing
32 changed files
with
162 additions
and
195 deletions
+162
-195
.prettierignore
.prettierignore
+0
-33
ee/spec/frontend/analytics/productivity_analytics/components/app_spec.js
...d/analytics/productivity_analytics/components/app_spec.js
+1
-1
ee/spec/frontend/analytics/productivity_analytics/helpers.js
ee/spec/frontend/analytics/productivity_analytics/helpers.js
+1
-1
ee/spec/frontend/analytics/productivity_analytics/store/actions_spec.js
...nd/analytics/productivity_analytics/store/actions_spec.js
+1
-1
ee/spec/frontend/analytics/productivity_analytics/store/modules/charts/actions_spec.js
...oductivity_analytics/store/modules/charts/actions_spec.js
+13
-13
ee/spec/frontend/analytics/productivity_analytics/store/modules/charts/getters_spec.js
...oductivity_analytics/store/modules/charts/getters_spec.js
+1
-1
ee/spec/frontend/analytics/productivity_analytics/store/modules/filters/actions_spec.js
...ductivity_analytics/store/modules/filters/actions_spec.js
+6
-6
ee/spec/frontend/analytics/productivity_analytics/store/modules/table/actions_spec.js
...roductivity_analytics/store/modules/table/actions_spec.js
+10
-10
ee/spec/frontend/analytics/repository_analytics/components/select_projects_dropdown_spec.js
...ory_analytics/components/select_projects_dropdown_spec.js
+2
-2
ee/spec/frontend/analytics/repository_analytics/components/test_coverage_table_spec.js
...pository_analytics/components/test_coverage_table_spec.js
+4
-4
ee/spec/frontend/analytics/shared/utils_spec.js
ee/spec/frontend/analytics/shared/utils_spec.js
+1
-1
ee/spec/frontend/api_spec.js
ee/spec/frontend/api_spec.js
+29
-29
ee/spec/frontend/approvals/components/approval_check_popover_spec.js
...ntend/approvals/components/approval_check_popover_spec.js
+1
-1
ee/spec/frontend/approvals/components/approval_check_rule_popover_spec.js
.../approvals/components/approval_check_rule_popover_spec.js
+11
-11
ee/spec/frontend/approvals/components/approvers_select_spec.js
...ec/frontend/approvals/components/approvers_select_spec.js
+7
-7
ee/spec/frontend/approvals/components/branches_select_spec.js
...pec/frontend/approvals/components/branches_select_spec.js
+11
-11
ee/spec/frontend/approvals/components/license_compliance/index_spec.js
...end/approvals/components/license_compliance/index_spec.js
+1
-1
ee/spec/frontend/approvals/components/license_compliance/modal_spec.js
...end/approvals/components/license_compliance/modal_spec.js
+1
-1
ee/spec/frontend/approvals/components/mr_edit/mr_rules_hidden_inputs_spec.js
...provals/components/mr_edit/mr_rules_hidden_inputs_spec.js
+4
-4
ee/spec/frontend/approvals/components/mr_edit/mr_rules_spec.js
...ec/frontend/approvals/components/mr_edit/mr_rules_spec.js
+4
-4
ee/spec/frontend/approvals/components/project_settings/project_rules_spec.js
...provals/components/project_settings/project_rules_spec.js
+4
-4
ee/spec/frontend/approvals/components/rule_form_spec.js
ee/spec/frontend/approvals/components/rule_form_spec.js
+33
-33
ee/spec/frontend/approvals/stores/modules/mr_edit/actions_spec.js
...frontend/approvals/stores/modules/mr_edit/actions_spec.js
+2
-2
ee/spec/frontend/approvals/stores/modules/project_settings/actions_spec.js
...approvals/stores/modules/project_settings/actions_spec.js
+1
-1
ee/spec/frontend/audit_events/components/audit_events_app_spec.js
...frontend/audit_events/components/audit_events_app_spec.js
+1
-1
ee/spec/frontend/audit_events/components/sorting_field_spec.js
...ec/frontend/audit_events/components/sorting_field_spec.js
+1
-1
ee/spec/frontend/audit_events/components/tokens/audit_filter_token_spec.js
...audit_events/components/tokens/audit_filter_token_spec.js
+1
-1
ee/spec/frontend/billings/helpers.js
ee/spec/frontend/billings/helpers.js
+1
-1
ee/spec/frontend/billings/seat_usage/components/subscription_seats_spec.js
...billings/seat_usage/components/subscription_seats_spec.js
+4
-4
ee/spec/frontend/billings/seat_usage/store/actions_spec.js
ee/spec/frontend/billings/seat_usage/store/actions_spec.js
+1
-1
ee/spec/frontend/billings/subscriptions/components/subscription_table_row_spec.js
...s/subscriptions/components/subscription_table_row_spec.js
+2
-2
ee/spec/frontend/billings/subscriptions/store/mutations_spec.js
...c/frontend/billings/subscriptions/store/mutations_spec.js
+2
-2
No files found.
.prettierignore
View file @
7f4e951c
...
...
@@ -1369,39 +1369,6 @@ ee/app/assets/javascripts/vulnerabilities/components/resolution_alert.vue
ee/app/assets/javascripts/vulnerabilities/helpers.js
ee/app/assets/javascripts/vulnerabilities/vulnerabilities_init.js
## inspiring-banach
ee/spec/frontend/analytics/productivity_analytics/components/app_spec.js
ee/spec/frontend/analytics/productivity_analytics/helpers.js
ee/spec/frontend/analytics/productivity_analytics/store/actions_spec.js
ee/spec/frontend/analytics/productivity_analytics/store/modules/charts/actions_spec.js
ee/spec/frontend/analytics/productivity_analytics/store/modules/charts/getters_spec.js
ee/spec/frontend/analytics/productivity_analytics/store/modules/filters/actions_spec.js
ee/spec/frontend/analytics/productivity_analytics/store/modules/table/actions_spec.js
ee/spec/frontend/analytics/repository_analytics/components/select_projects_dropdown_spec.js
ee/spec/frontend/analytics/repository_analytics/components/test_coverage_table_spec.js
ee/spec/frontend/analytics/shared/utils_spec.js
ee/spec/frontend/api_spec.js
ee/spec/frontend/approvals/components/approval_check_popover_spec.js
ee/spec/frontend/approvals/components/approval_check_rule_popover_spec.js
ee/spec/frontend/approvals/components/approvers_select_spec.js
ee/spec/frontend/approvals/components/branches_select_spec.js
ee/spec/frontend/approvals/components/license_compliance/index_spec.js
ee/spec/frontend/approvals/components/license_compliance/modal_spec.js
ee/spec/frontend/approvals/components/mr_edit/mr_rules_hidden_inputs_spec.js
ee/spec/frontend/approvals/components/mr_edit/mr_rules_spec.js
ee/spec/frontend/approvals/components/project_settings/project_rules_spec.js
ee/spec/frontend/approvals/components/rule_form_spec.js
ee/spec/frontend/approvals/stores/modules/mr_edit/actions_spec.js
ee/spec/frontend/approvals/stores/modules/project_settings/actions_spec.js
ee/spec/frontend/audit_events/components/audit_events_app_spec.js
ee/spec/frontend/audit_events/components/sorting_field_spec.js
ee/spec/frontend/audit_events/components/tokens/audit_filter_token_spec.js
ee/spec/frontend/billings/helpers.js
ee/spec/frontend/billings/seat_usage/components/subscription_seats_spec.js
ee/spec/frontend/billings/seat_usage/store/actions_spec.js
ee/spec/frontend/billings/subscriptions/components/subscription_table_row_spec.js
ee/spec/frontend/billings/subscriptions/store/mutations_spec.js
## keen-napier
ee/spec/frontend/boards/components/assignee_select_spec.js
ee/spec/frontend/boards/components/board_list_header_new_spec.js
...
...
ee/spec/frontend/analytics/productivity_analytics/components/app_spec.js
View file @
7f4e951c
...
...
@@ -570,7 +570,7 @@ describe('ProductivityApp component', () => {
milestone_title
:
null
,
};
const
shouldSetUrlParams
=
result
=>
{
const
shouldSetUrlParams
=
(
result
)
=>
{
expect
(
urlUtils
.
setUrlParams
).
toHaveBeenCalledWith
(
result
,
window
.
location
.
href
,
true
);
expect
(
commonUtils
.
historyPushState
).
toHaveBeenCalled
();
};
...
...
ee/spec/frontend/analytics/productivity_analytics/helpers.js
View file @
7f4e951c
...
...
@@ -3,7 +3,7 @@ import filterState from 'ee/analytics/productivity_analytics/store/modules/filte
import
tableState
from
'
ee/analytics/productivity_analytics/store/modules/table/state
'
;
import
state
from
'
ee/analytics/productivity_analytics/store/state
'
;
const
resetStore
=
store
=>
{
const
resetStore
=
(
store
)
=>
{
const
newState
=
{
...
state
(),
filters
:
filterState
(),
...
...
ee/spec/frontend/analytics/productivity_analytics/store/actions_spec.js
View file @
7f4e951c
...
...
@@ -5,7 +5,7 @@ import testAction from 'helpers/vuex_action_helper';
describe
(
'
Productivity analytics actions
'
,
()
=>
{
describe
(
'
setEndpoint
'
,
()
=>
{
it
(
'
commits the SET_ENDPOINT mutation
'
,
done
=>
it
(
'
commits the SET_ENDPOINT mutation
'
,
(
done
)
=>
testAction
(
actions
.
setEndpoint
,
'
endpoint.json
'
,
...
...
ee/spec/frontend/analytics/productivity_analytics/store/modules/charts/actions_spec.js
View file @
7f4e951c
...
...
@@ -72,7 +72,7 @@ describe('Productivity analytics chart actions', () => {
expect
(
axios
.
get
).
toHaveBeenCalledWith
(
mockedState
.
endpoint
,
{
params
:
globalParams
});
});
it
(
'
dispatches success with received data
'
,
done
=>
it
(
'
dispatches success with received data
'
,
(
done
)
=>
testAction
(
actions
.
fetchChartData
,
chartKey
,
...
...
@@ -94,7 +94,7 @@ describe('Productivity analytics chart actions', () => {
mock
.
onGet
(
mockedState
.
endpoint
).
replyOnce
(
200
,
mockScatterplotData
);
});
it
(
'
dispatches success with received data and transformedData
'
,
done
=>
{
it
(
'
dispatches success with received data and transformedData
'
,
(
done
)
=>
{
testAction
(
actions
.
fetchChartData
,
chartKeys
.
scatterplot
,
...
...
@@ -122,7 +122,7 @@ describe('Productivity analytics chart actions', () => {
mock
.
onGet
(
mockedState
.
endpoint
).
replyOnce
(
500
);
});
it
(
'
dispatches error
'
,
done
=>
{
it
(
'
dispatches error
'
,
(
done
)
=>
{
testAction
(
actions
.
fetchChartData
,
chartKey
,
...
...
@@ -149,7 +149,7 @@ describe('Productivity analytics chart actions', () => {
});
describe
(
'
requestChartData
'
,
()
=>
{
it
(
'
should commit the request mutation
'
,
done
=>
{
it
(
'
should commit the request mutation
'
,
(
done
)
=>
{
testAction
(
actions
.
requestChartData
,
chartKey
,
...
...
@@ -167,7 +167,7 @@ describe('Productivity analytics chart actions', () => {
mockedState
.
charts
[
disabledChartKey
].
enabled
=
false
;
});
it
(
'
does not dispatch the requestChartData action
'
,
done
=>
{
it
(
'
does not dispatch the requestChartData action
'
,
(
done
)
=>
{
testAction
(
actions
.
fetchChartData
,
disabledChartKey
,
mockedState
,
[],
[],
done
);
});
...
...
@@ -180,7 +180,7 @@ describe('Productivity analytics chart actions', () => {
});
describe
(
'
receiveChartDataSuccess
'
,
()
=>
{
it
(
'
should commit received data
'
,
done
=>
{
it
(
'
should commit received data
'
,
(
done
)
=>
{
testAction
(
actions
.
receiveChartDataSuccess
,
{
chartKey
,
data
:
mockHistogramData
},
...
...
@@ -198,7 +198,7 @@ describe('Productivity analytics chart actions', () => {
});
describe
(
'
receiveChartDataError
'
,
()
=>
{
it
(
'
should commit error
'
,
done
=>
{
it
(
'
should commit error
'
,
(
done
)
=>
{
const
error
=
{
response
:
{
status
:
500
}
};
testAction
(
actions
.
receiveChartDataError
,
...
...
@@ -220,7 +220,7 @@ describe('Productivity analytics chart actions', () => {
});
describe
(
'
fetchSecondaryChartData
'
,
()
=>
{
it
(
'
dispatches fetchChartData for all chart types except for the main chart
'
,
done
=>
{
it
(
'
dispatches fetchChartData for all chart types except for the main chart
'
,
(
done
)
=>
{
testAction
(
actions
.
fetchSecondaryChartData
,
null
,
...
...
@@ -239,7 +239,7 @@ describe('Productivity analytics chart actions', () => {
describe
(
'
setMetricType
'
,
()
=>
{
const
metricType
=
'
time_to_merge
'
;
it
(
'
should commit metricType
'
,
done
=>
{
it
(
'
should commit metricType
'
,
(
done
)
=>
{
testAction
(
actions
.
setMetricType
,
{
chartKey
,
metricType
},
...
...
@@ -252,7 +252,7 @@ describe('Productivity analytics chart actions', () => {
});
describe
(
'
updateSelectedItems
'
,
()
=>
{
it
(
'
should commit selected chart item and dispatch fetchSecondaryChartData and setPage
'
,
done
=>
{
it
(
'
should commit selected chart item and dispatch fetchSecondaryChartData and setPage
'
,
(
done
)
=>
{
testAction
(
actions
.
updateSelectedItems
,
{
chartKey
,
item
:
5
},
...
...
@@ -266,7 +266,7 @@ describe('Productivity analytics chart actions', () => {
describe
(
'
resetMainChartSelection
'
,
()
=>
{
describe
(
'
when skipReload is false (by default)
'
,
()
=>
{
it
(
'
should commit selected chart item and dispatch fetchSecondaryChartData and setPage
'
,
done
=>
{
it
(
'
should commit selected chart item and dispatch fetchSecondaryChartData and setPage
'
,
(
done
)
=>
{
testAction
(
actions
.
resetMainChartSelection
,
null
,
...
...
@@ -279,7 +279,7 @@ describe('Productivity analytics chart actions', () => {
});
describe
(
'
when skipReload is true
'
,
()
=>
{
it
(
'
should commit selected chart and it should not dispatch any further actions
'
,
done
=>
{
it
(
'
should commit selected chart and it should not dispatch any further actions
'
,
(
done
)
=>
{
testAction
(
actions
.
resetMainChartSelection
,
true
,
...
...
@@ -298,7 +298,7 @@ describe('Productivity analytics chart actions', () => {
});
describe
(
'
setChartEnabled
'
,
()
=>
{
it
(
'
should commit enabled state
'
,
done
=>
{
it
(
'
should commit enabled state
'
,
(
done
)
=>
{
testAction
(
actions
.
setChartEnabled
,
{
chartKey
:
chartKeys
.
scatterplot
,
isEnabled
:
false
},
...
...
ee/spec/frontend/analytics/productivity_analytics/store/modules/charts/getters_spec.js
View file @
7f4e951c
...
...
@@ -255,7 +255,7 @@ describe('Productivity analytics chart getters', () => {
expect
(
getters
.
scatterplotYaxisLabel
(
null
,
mockGetters
,
mockRootState
)).
toBe
(
'
Days
'
);
});
it
.
each
(
metricsInHours
)(
'
returns "Hours" for the "%s" metric
'
,
metric
=>
{
it
.
each
(
metricsInHours
)(
'
returns "Hours" for the "%s" metric
'
,
(
metric
)
=>
{
const
mockGetters
=
{
getSelectedMetric
:
()
=>
metric
,
};
...
...
ee/spec/frontend/analytics/productivity_analytics/store/modules/filters/actions_spec.js
View file @
7f4e951c
...
...
@@ -30,7 +30,7 @@ describe('Productivity analytics filter actions', () => {
});
describe
(
'
setInitialData
'
,
()
=>
{
it
(
'
commits the SET_INITIAL_DATA mutation and fetches data by default
'
,
done
=>
{
it
(
'
commits the SET_INITIAL_DATA mutation and fetches data by default
'
,
(
done
)
=>
{
actions
.
setInitialData
(
store
,
{
data
:
initialData
})
.
then
(()
=>
{
...
...
@@ -54,7 +54,7 @@ describe('Productivity analytics filter actions', () => {
.
catch
(
done
.
fail
);
});
it
(
"
commits the SET_INITIAL_DATA mutation and doesn't fetch data when skipFetch=true
"
,
done
=>
it
(
"
commits the SET_INITIAL_DATA mutation and doesn't fetch data when skipFetch=true
"
,
(
done
)
=>
testAction
(
actions
.
setInitialData
,
{
skipFetch
:
true
,
data
:
initialData
},
...
...
@@ -71,7 +71,7 @@ describe('Productivity analytics filter actions', () => {
});
describe
(
'
setGroupNamespace
'
,
()
=>
{
it
(
'
commits the SET_GROUP_NAMESPACE mutation
'
,
done
=>
{
it
(
'
commits the SET_GROUP_NAMESPACE mutation
'
,
(
done
)
=>
{
actions
.
setGroupNamespace
(
store
,
groupNamespace
)
.
then
(()
=>
{
...
...
@@ -103,7 +103,7 @@ describe('Productivity analytics filter actions', () => {
});
describe
(
'
setProjectPath
'
,
()
=>
{
it
(
'
commits the SET_PROJECT_PATH mutation
'
,
done
=>
{
it
(
'
commits the SET_PROJECT_PATH mutation
'
,
(
done
)
=>
{
actions
.
setProjectPath
(
store
,
projectPath
)
.
then
(()
=>
{
...
...
@@ -135,7 +135,7 @@ describe('Productivity analytics filter actions', () => {
});
describe
(
'
setFilters
'
,
()
=>
{
it
(
'
commits the SET_FILTERS mutation
'
,
done
=>
{
it
(
'
commits the SET_FILTERS mutation
'
,
(
done
)
=>
{
actions
.
setFilters
(
store
,
{
author_username
:
'
root
'
})
.
then
(()
=>
{
...
...
@@ -167,7 +167,7 @@ describe('Productivity analytics filter actions', () => {
});
describe
(
'
setDateRange
'
,
()
=>
{
it
(
'
commits the SET_DATE_RANGE mutation
'
,
done
=>
{
it
(
'
commits the SET_DATE_RANGE mutation
'
,
(
done
)
=>
{
actions
.
setDateRange
(
store
,
{
startDate
,
endDate
})
.
then
(()
=>
{
...
...
ee/spec/frontend/analytics/productivity_analytics/store/modules/table/actions_spec.js
View file @
7f4e951c
...
...
@@ -104,7 +104,7 @@ describe('Productivity analytics table actions', () => {
});
});
it
(
'
dispatches success with received data
'
,
done
=>
it
(
'
dispatches success with received data
'
,
(
done
)
=>
testAction
(
actions
.
fetchMergeRequests
,
null
,
...
...
@@ -126,7 +126,7 @@ describe('Productivity analytics table actions', () => {
mock
.
onGet
(
mockedState
.
endpoint
).
replyOnce
(
500
);
});
it
(
'
dispatches error
'
,
done
=>
{
it
(
'
dispatches error
'
,
(
done
)
=>
{
testAction
(
actions
.
fetchMergeRequests
,
null
,
...
...
@@ -146,7 +146,7 @@ describe('Productivity analytics table actions', () => {
});
describe
(
'
requestMergeRequests
'
,
()
=>
{
it
(
'
should commit the request mutation
'
,
done
=>
it
(
'
should commit the request mutation
'
,
(
done
)
=>
testAction
(
actions
.
requestMergeRequests
,
null
,
...
...
@@ -158,7 +158,7 @@ describe('Productivity analytics table actions', () => {
});
describe
(
'
receiveMergeRequestsSuccess
'
,
()
=>
{
it
(
'
should commit received data
'
,
done
=>
it
(
'
should commit received data
'
,
(
done
)
=>
testAction
(
actions
.
receiveMergeRequestsSuccess
,
{
headers
,
data
:
mockMergeRequests
},
...
...
@@ -175,7 +175,7 @@ describe('Productivity analytics table actions', () => {
});
describe
(
'
receiveMergeRequestsError
'
,
()
=>
{
it
(
'
should commit error
'
,
done
=>
it
(
'
should commit error
'
,
(
done
)
=>
testAction
(
actions
.
receiveMergeRequestsError
,
{
response
:
{
status
:
500
}
},
...
...
@@ -187,7 +187,7 @@ describe('Productivity analytics table actions', () => {
});
describe
(
'
setSortField
'
,
()
=>
{
it
(
'
should commit setSortField
'
,
done
=>
it
(
'
should commit setSortField
'
,
(
done
)
=>
testAction
(
actions
.
setSortField
,
'
time_to_last_commit
'
,
...
...
@@ -200,7 +200,7 @@ describe('Productivity analytics table actions', () => {
done
,
));
it
(
'
should not dispatch setColumnMetric when metric is "days_to_merge"
'
,
done
=>
it
(
'
should not dispatch setColumnMetric when metric is "days_to_merge"
'
,
(
done
)
=>
testAction
(
actions
.
setSortField
,
'
days_to_merge
'
,
...
...
@@ -212,7 +212,7 @@ describe('Productivity analytics table actions', () => {
});
describe
(
'
toggleSortOrder
'
,
()
=>
{
it
(
'
should commit toggleSortOrder
'
,
done
=>
it
(
'
should commit toggleSortOrder
'
,
(
done
)
=>
testAction
(
actions
.
toggleSortOrder
,
null
,
...
...
@@ -224,7 +224,7 @@ describe('Productivity analytics table actions', () => {
});
describe
(
'
setColumnMetric
'
,
()
=>
{
it
(
'
should commit setColumnMetric
'
,
done
=>
it
(
'
should commit setColumnMetric
'
,
(
done
)
=>
testAction
(
actions
.
setColumnMetric
,
'
time_to_first_comment
'
,
...
...
@@ -236,7 +236,7 @@ describe('Productivity analytics table actions', () => {
});
describe
(
'
setPage
'
,
()
=>
{
it
(
'
should commit setPage
'
,
done
=>
it
(
'
should commit setPage
'
,
(
done
)
=>
testAction
(
actions
.
setPage
,
2
,
...
...
ee/spec/frontend/analytics/repository_analytics/components/select_projects_dropdown_spec.js
View file @
7f4e951c
...
...
@@ -14,9 +14,9 @@ describe('Select projects dropdown component', () => {
let
wrapper
;
const
findSelectAllProjects
=
()
=>
wrapper
.
find
(
'
[data-testid="select-all-projects"]
'
);
const
findProjectById
=
id
=>
wrapper
.
find
(
`[data-testid="select-project-
${
id
}
"]`
);
const
findProjectById
=
(
id
)
=>
wrapper
.
find
(
`[data-testid="select-project-
${
id
}
"]`
);
const
selectAllProjects
=
()
=>
findSelectAllProjects
().
trigger
(
'
click
'
);
const
selectProjectById
=
id
=>
findProjectById
(
id
).
trigger
(
'
click
'
);
const
selectProjectById
=
(
id
)
=>
findProjectById
(
id
).
trigger
(
'
click
'
);
const
findIntersectionObserver
=
()
=>
wrapper
.
find
(
GlIntersectionObserver
);
const
findLoadingIcon
=
()
=>
wrapper
.
find
(
GlLoadingIcon
);
...
...
ee/spec/frontend/analytics/repository_analytics/components/test_coverage_table_spec.js
View file @
7f4e951c
...
...
@@ -18,10 +18,10 @@ describe('Test coverage table component', () => {
const
findLoadingState
=
()
=>
wrapper
.
find
(
'
[data-testid="test-coverage-loading-state"
'
);
const
findTable
=
()
=>
wrapper
.
find
(
'
[data-testid="test-coverage-data-table"
'
);
const
findTableRows
=
()
=>
findTable
().
findAll
(
'
tbody tr
'
);
const
findProjectNameById
=
id
=>
wrapper
.
find
(
`[data-testid="
${
id
}
-name"`
);
const
findProjectAverageById
=
id
=>
wrapper
.
find
(
`[data-testid="
${
id
}
-average"`
);
const
findProjectCountById
=
id
=>
wrapper
.
find
(
`[data-testid="
${
id
}
-count"`
);
const
findProjectDateById
=
id
=>
wrapper
.
find
(
`[data-testid="
${
id
}
-date"`
);
const
findProjectNameById
=
(
id
)
=>
wrapper
.
find
(
`[data-testid="
${
id
}
-name"`
);
const
findProjectAverageById
=
(
id
)
=>
wrapper
.
find
(
`[data-testid="
${
id
}
-average"`
);
const
findProjectCountById
=
(
id
)
=>
wrapper
.
find
(
`[data-testid="
${
id
}
-count"`
);
const
findProjectDateById
=
(
id
)
=>
wrapper
.
find
(
`[data-testid="
${
id
}
-date"`
);
const
createComponent
=
({
data
=
{},
mountFn
=
shallowMount
}
=
{})
=>
{
wrapper
=
mountFn
(
TestCoverageTable
,
{
...
...
ee/spec/frontend/analytics/shared/utils_spec.js
View file @
7f4e951c
...
...
@@ -192,7 +192,7 @@ describe('buildCycleAnalyticsInitialData', () => {
});
it
(
'
with no search term returns the data
'
,
()
=>
{
[
''
,
null
].
forEach
(
search
=>
{
[
''
,
null
].
forEach
(
(
search
)
=>
{
expect
(
filterBySearchTerm
(
data
,
search
)).
toEqual
(
data
);
});
});
...
...
ee/spec/frontend/api_spec.js
View file @
7f4e951c
...
...
@@ -42,7 +42,7 @@ describe('Api', () => {
});
describe
(
'
ldapGroups
'
,
()
=>
{
it
(
'
calls callback on completion
'
,
done
=>
{
it
(
'
calls callback on completion
'
,
(
done
)
=>
{
const
query
=
'
query
'
;
const
provider
=
'
provider
'
;
const
callback
=
jest
.
fn
();
...
...
@@ -55,7 +55,7 @@ describe('Api', () => {
]);
Api
.
ldapGroups
(
query
,
provider
,
callback
)
.
then
(
response
=>
{
.
then
(
(
response
)
=>
{
expect
(
callback
).
toHaveBeenCalledWith
(
response
);
})
.
then
(
done
)
...
...
@@ -64,7 +64,7 @@ describe('Api', () => {
});
describe
(
'
createChildEpic
'
,
()
=>
{
it
(
'
calls `axios.post` using params `groupId`, `parentEpicIid` and title
'
,
done
=>
{
it
(
'
calls `axios.post` using params `groupId`, `parentEpicIid` and title
'
,
(
done
)
=>
{
const
groupId
=
'
gitlab-org
'
;
const
parentEpicId
=
1
;
const
title
=
'
Sample epic
'
;
...
...
@@ -89,7 +89,7 @@ describe('Api', () => {
});
describe
(
'
groupEpics
'
,
()
=>
{
it
(
'
calls `axios.get` using param `groupId`
'
,
done
=>
{
it
(
'
calls `axios.get` using param `groupId`
'
,
(
done
)
=>
{
const
groupId
=
2
;
const
expectedUrl
=
`
${
dummyUrlRoot
}
/api/
${
dummyApiVersion
}
/groups/
${
groupId
}
/epics`
;
...
...
@@ -115,7 +115,7 @@ describe('Api', () => {
.
catch
(
done
.
fail
);
});
it
(
'
calls `axios.get` using param `search` when it is provided
'
,
done
=>
{
it
(
'
calls `axios.get` using param `search` when it is provided
'
,
(
done
)
=>
{
const
groupId
=
2
;
const
expectedUrl
=
`
${
dummyUrlRoot
}
/api/
${
dummyApiVersion
}
/groups/
${
groupId
}
/epics`
;
...
...
@@ -144,7 +144,7 @@ describe('Api', () => {
});
describe
(
'
addEpicIssue
'
,
()
=>
{
it
(
'
calls `axios.post` using params `groupId`, `epicIid` and `issueId`
'
,
done
=>
{
it
(
'
calls `axios.post` using params `groupId`, `epicIid` and `issueId`
'
,
(
done
)
=>
{
const
groupId
=
2
;
const
mockIssue
=
{
id
:
20
,
...
...
@@ -170,7 +170,7 @@ describe('Api', () => {
});
describe
(
'
removeEpicIssue
'
,
()
=>
{
it
(
'
calls `axios.delete` using params `groupId`, `epicIid` and `epicIssueId`
'
,
done
=>
{
it
(
'
calls `axios.delete` using params `groupId`, `epicIid` and `epicIssueId`
'
,
(
done
)
=>
{
const
groupId
=
2
;
const
mockIssue
=
{
id
:
20
,
...
...
@@ -227,7 +227,7 @@ describe('Api', () => {
};
describe
(
'
cycleAnalyticsTasksByType
'
,
()
=>
{
it
(
'
fetches tasks by type data
'
,
done
=>
{
it
(
'
fetches tasks by type data
'
,
(
done
)
=>
{
const
tasksByTypeResponse
=
[
{
label
:
{
...
...
@@ -266,7 +266,7 @@ describe('Api', () => {
});
describe
(
'
cycleAnalyticsTopLabels
'
,
()
=>
{
it
(
'
fetches top group level labels
'
,
done
=>
{
it
(
'
fetches top group level labels
'
,
(
done
)
=>
{
const
response
=
[];
const
labelIds
=
[
10
,
9
,
8
,
7
];
const
params
=
{
...
...
@@ -291,7 +291,7 @@ describe('Api', () => {
});
describe
(
'
cycleAnalyticsSummaryData
'
,
()
=>
{
it
(
'
fetches value stream analytics summary data
'
,
done
=>
{
it
(
'
fetches value stream analytics summary data
'
,
(
done
)
=>
{
const
response
=
[
{
value
:
0
,
title
:
'
New Issues
'
},
{
value
:
0
,
title
:
'
Deploys
'
},
...
...
@@ -301,7 +301,7 @@ describe('Api', () => {
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
Api
.
cycleAnalyticsSummaryData
(
groupId
,
params
)
.
then
(
responseObj
=>
.
then
(
(
responseObj
)
=>
expectRequestWithCorrectParameters
(
responseObj
,
{
response
,
params
,
...
...
@@ -314,7 +314,7 @@ describe('Api', () => {
});
describe
(
'
cycleAnalyticsTimeSummaryData
'
,
()
=>
{
it
(
'
fetches value stream analytics summary data
'
,
done
=>
{
it
(
'
fetches value stream analytics summary data
'
,
(
done
)
=>
{
const
response
=
[
{
value
:
'
10.0
'
,
title
:
'
Lead time
'
,
unit
:
'
per day
'
},
{
value
:
'
2.0
'
,
title
:
'
Cycle Time
'
,
unit
:
'
per day
'
},
...
...
@@ -325,7 +325,7 @@ describe('Api', () => {
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
Api
.
cycleAnalyticsTimeSummaryData
(
groupId
,
params
)
.
then
(
responseObj
=>
.
then
(
(
responseObj
)
=>
expectRequestWithCorrectParameters
(
responseObj
,
{
response
,
params
,
...
...
@@ -338,13 +338,13 @@ describe('Api', () => {
});
describe
(
'
cycleAnalyticsValueStreams
'
,
()
=>
{
it
(
'
fetches custom value streams
'
,
done
=>
{
it
(
'
fetches custom value streams
'
,
(
done
)
=>
{
const
response
=
[{
name
:
'
value stream 1
'
,
id
:
1
}];
const
expectedUrl
=
valueStreamBaseUrl
({
resource
:
'
value_streams
'
});
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
Api
.
cycleAnalyticsValueStreams
(
groupId
)
.
then
(
responseObj
=>
.
then
(
(
responseObj
)
=>
expectRequestWithCorrectParameters
(
responseObj
,
{
response
,
expectedUrl
,
...
...
@@ -356,7 +356,7 @@ describe('Api', () => {
});
describe
(
'
cycleAnalyticsCreateValueStream
'
,
()
=>
{
it
(
'
submit the custom value stream data
'
,
done
=>
{
it
(
'
submit the custom value stream data
'
,
(
done
)
=>
{
const
response
=
{};
const
customValueStream
=
{
name
:
'
cool-value-stream-stage
'
};
const
expectedUrl
=
valueStreamBaseUrl
({
resource
:
'
value_streams
'
});
...
...
@@ -374,7 +374,7 @@ describe('Api', () => {
});
describe
(
'
cycleAnalyticsDeleteValueStream
'
,
()
=>
{
it
(
'
delete the custom value stream
'
,
done
=>
{
it
(
'
delete the custom value stream
'
,
(
done
)
=>
{
const
response
=
{};
const
expectedUrl
=
valueStreamBaseUrl
({
resource
:
`value_streams/
${
valueStreamId
}
`
});
mock
.
onDelete
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
...
...
@@ -390,7 +390,7 @@ describe('Api', () => {
});
describe
(
'
cycleAnalyticsGroupStagesAndEvents
'
,
()
=>
{
it
(
'
fetches custom stage events and all stages
'
,
done
=>
{
it
(
'
fetches custom stage events and all stages
'
,
(
done
)
=>
{
const
response
=
{
events
:
[],
stages
:
[]
};
const
params
=
{
group_id
:
groupId
,
...
...
@@ -401,7 +401,7 @@ describe('Api', () => {
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
Api
.
cycleAnalyticsGroupStagesAndEvents
({
groupId
,
valueStreamId
,
params
})
.
then
(
responseObj
=>
.
then
(
(
responseObj
)
=>
expectRequestWithCorrectParameters
(
responseObj
,
{
response
,
params
,
...
...
@@ -414,7 +414,7 @@ describe('Api', () => {
});
describe
(
'
cycleAnalyticsStageEvents
'
,
()
=>
{
it
(
'
fetches stage events
'
,
done
=>
{
it
(
'
fetches stage events
'
,
(
done
)
=>
{
const
response
=
{
events
:
[]
};
const
params
=
{
...
defaultParams
};
const
expectedUrl
=
valueStreamBaseUrl
({
...
...
@@ -424,7 +424,7 @@ describe('Api', () => {
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
Api
.
cycleAnalyticsStageEvents
({
groupId
,
valueStreamId
,
stageId
,
params
})
.
then
(
responseObj
=>
.
then
(
(
responseObj
)
=>
expectRequestWithCorrectParameters
(
responseObj
,
{
response
,
params
,
...
...
@@ -437,7 +437,7 @@ describe('Api', () => {
});
describe
(
'
cycleAnalyticsStageMedian
'
,
()
=>
{
it
(
'
fetches stage events
'
,
done
=>
{
it
(
'
fetches stage events
'
,
(
done
)
=>
{
const
response
=
{
value
:
'
5 days ago
'
};
const
params
=
{
...
defaultParams
};
const
expectedUrl
=
valueStreamBaseUrl
({
...
...
@@ -447,7 +447,7 @@ describe('Api', () => {
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
Api
.
cycleAnalyticsStageMedian
({
groupId
,
valueStreamId
,
stageId
,
params
})
.
then
(
responseObj
=>
.
then
(
(
responseObj
)
=>
expectRequestWithCorrectParameters
(
responseObj
,
{
response
,
params
,
...
...
@@ -460,7 +460,7 @@ describe('Api', () => {
});
describe
(
'
cycleAnalyticsCreateStage
'
,
()
=>
{
it
(
'
submit the custom stage data
'
,
done
=>
{
it
(
'
submit the custom stage data
'
,
(
done
)
=>
{
const
response
=
{};
const
customStage
=
{
name
:
'
cool-stage
'
,
...
...
@@ -488,7 +488,7 @@ describe('Api', () => {
});
describe
(
'
cycleAnalyticsUpdateStage
'
,
()
=>
{
it
(
'
updates the stage data
'
,
done
=>
{
it
(
'
updates the stage data
'
,
(
done
)
=>
{
const
response
=
{
id
:
stageId
,
custom
:
false
,
hidden
:
true
,
name
:
'
nice-stage
'
};
const
stageData
=
{
name
:
'
nice-stage
'
,
hidden
:
true
};
const
expectedUrl
=
valueStreamBaseUrl
({
...
...
@@ -509,7 +509,7 @@ describe('Api', () => {
});
describe
(
'
cycleAnalyticsRemoveStage
'
,
()
=>
{
it
(
'
deletes the specified data
'
,
done
=>
{
it
(
'
deletes the specified data
'
,
(
done
)
=>
{
const
response
=
{
id
:
stageId
,
hidden
:
true
,
custom
:
true
};
const
expectedUrl
=
valueStreamBaseUrl
({
id
:
valueStreamId
,
...
...
@@ -529,7 +529,7 @@ describe('Api', () => {
});
describe
(
'
cycleAnalyticsDurationChart
'
,
()
=>
{
it
(
'
fetches stage duration data
'
,
done
=>
{
it
(
'
fetches stage duration data
'
,
(
done
)
=>
{
const
response
=
[];
const
params
=
{
...
defaultParams
};
const
expectedUrl
=
valueStreamBaseUrl
({
...
...
@@ -539,7 +539,7 @@ describe('Api', () => {
mock
.
onGet
(
expectedUrl
).
reply
(
httpStatus
.
OK
,
response
);
Api
.
cycleAnalyticsDurationChart
({
groupId
,
valueStreamId
,
stageId
,
params
})
.
then
(
responseObj
=>
.
then
(
(
responseObj
)
=>
expectRequestWithCorrectParameters
(
responseObj
,
{
response
,
params
,
...
...
@@ -552,7 +552,7 @@ describe('Api', () => {
});
describe
(
'
cycleAnalyticsGroupLabels
'
,
()
=>
{
it
(
'
fetches group level labels
'
,
done
=>
{
it
(
'
fetches group level labels
'
,
(
done
)
=>
{
const
response
=
[];
const
expectedUrl
=
`
${
dummyUrlRoot
}
/groups/
${
groupId
}
/-/labels.json`
;
...
...
ee/spec/frontend/approvals/components/approval_check_popover_spec.js
View file @
7f4e951c
...
...
@@ -17,7 +17,7 @@ describe('Approval Check Popover', () => {
describe
(
'
with a documentation link
'
,
()
=>
{
const
documentationLink
=
`
${
TEST_HOST
}
/documentation`
;
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
wrapper
.
setProps
({
documentationLink
,
});
...
...
ee/spec/frontend/approvals/components/approval_check_rule_popover_spec.js
View file @
7f4e951c
...
...
@@ -20,20 +20,20 @@ describe('Approval Check Popover', () => {
describe
(
'
computed props
'
,
()
=>
{
const
securityApprovalsHelpPagePath
=
`
${
TEST_HOST
}
/documentation`
;
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
wrapper
.
setProps
({
securityApprovalsHelpPagePath
});
Vue
.
nextTick
(
done
);
});
describe
(
'
showVulnerabilityCheckPopover
'
,
()
=>
{
it
(
'
return true if the rule type is "Vulnerability-Check"
'
,
done
=>
{
it
(
'
return true if the rule type is "Vulnerability-Check"
'
,
(
done
)
=>
{
wrapper
.
setProps
({
rule
:
{
name
:
VULNERABILITY_CHECK_NAME
}
});
Vue
.
nextTick
(()
=>
{
expect
(
wrapper
.
vm
.
showVulnerabilityCheckPopover
).
toBe
(
true
);
done
();
});
});
it
(
'
return false if the rule type is "Vulnerability-Check"
'
,
done
=>
{
it
(
'
return false if the rule type is "Vulnerability-Check"
'
,
(
done
)
=>
{
wrapper
.
setProps
({
rule
:
{
name
:
'
FooRule
'
}
});
Vue
.
nextTick
(()
=>
{
expect
(
wrapper
.
vm
.
showVulnerabilityCheckPopover
).
toBe
(
false
);
...
...
@@ -43,14 +43,14 @@ describe('Approval Check Popover', () => {
});
describe
(
'
showLicenseCheckPopover
'
,
()
=>
{
it
(
'
return true if the rule type is "License-Check"
'
,
done
=>
{
it
(
'
return true if the rule type is "License-Check"
'
,
(
done
)
=>
{
wrapper
.
setProps
({
rule
:
{
name
:
LICENSE_CHECK_NAME
}
});
Vue
.
nextTick
(()
=>
{
expect
(
wrapper
.
vm
.
showLicenseCheckPopover
).
toBe
(
true
);
done
();
});
});
it
(
'
return false if the rule type is "License-Check"
'
,
done
=>
{
it
(
'
return false if the rule type is "License-Check"
'
,
(
done
)
=>
{
wrapper
.
setProps
({
rule
:
{
name
:
'
FooRule
'
}
});
Vue
.
nextTick
(()
=>
{
expect
(
wrapper
.
vm
.
showLicenseCheckPopover
).
toBe
(
false
);
...
...
@@ -60,7 +60,7 @@ describe('Approval Check Popover', () => {
});
describe
(
'
approvalConfig
'
,
()
=>
{
it
(
'
returns "Vulberability-Check" config
'
,
done
=>
{
it
(
'
returns "Vulberability-Check" config
'
,
(
done
)
=>
{
wrapper
.
setProps
({
rule
:
{
name
:
VULNERABILITY_CHECK_NAME
}
});
Vue
.
nextTick
(()
=>
{
expect
(
wrapper
.
vm
.
approvalRuleConfig
.
title
).
toBe
(
...
...
@@ -75,7 +75,7 @@ describe('Approval Check Popover', () => {
done
();
});
});
it
(
'
returns "License-Check" config
'
,
done
=>
{
it
(
'
returns "License-Check" config
'
,
(
done
)
=>
{
wrapper
.
setProps
({
rule
:
{
name
:
LICENSE_CHECK_NAME
}
});
Vue
.
nextTick
(()
=>
{
expect
(
wrapper
.
vm
.
approvalRuleConfig
.
title
).
toBe
(
...
...
@@ -90,7 +90,7 @@ describe('Approval Check Popover', () => {
done
();
});
});
it
(
'
returns an undefined config
'
,
done
=>
{
it
(
'
returns an undefined config
'
,
(
done
)
=>
{
wrapper
.
setProps
({
rule
:
{
name
:
'
FooRule
'
}
});
Vue
.
nextTick
(()
=>
{
expect
(
wrapper
.
vm
.
approvalConfig
).
toBe
(
undefined
);
...
...
@@ -100,21 +100,21 @@ describe('Approval Check Popover', () => {
});
describe
(
'
documentationLink
'
,
()
=>
{
it
(
'
returns documentation link for "License-Check"
'
,
done
=>
{
it
(
'
returns documentation link for "License-Check"
'
,
(
done
)
=>
{
wrapper
.
setProps
({
rule
:
{
name
:
'
License-Check
'
}
});
Vue
.
nextTick
(()
=>
{
expect
(
wrapper
.
vm
.
documentationLink
).
toBe
(
securityApprovalsHelpPagePath
);
done
();
});
});
it
(
'
returns documentation link for "Vulnerability-Check"
'
,
done
=>
{
it
(
'
returns documentation link for "Vulnerability-Check"
'
,
(
done
)
=>
{
wrapper
.
setProps
({
rule
:
{
name
:
'
Vulnerability-Check
'
}
});
Vue
.
nextTick
(()
=>
{
expect
(
wrapper
.
vm
.
documentationLink
).
toBe
(
securityApprovalsHelpPagePath
);
done
();
});
});
it
(
'
returns empty text
'
,
done
=>
{
it
(
'
returns empty text
'
,
(
done
)
=>
{
const
text
=
''
;
wrapper
.
setProps
({
rule
:
{
name
:
'
FooRule
'
}
});
Vue
.
nextTick
(()
=>
{
...
...
ee/spec/frontend/approvals/components/approvers_select_spec.js
View file @
7f4e951c
...
...
@@ -26,13 +26,13 @@ const TEST_USERS = [
const
localVue
=
createLocalVue
();
const
waitForEvent
=
(
$input
,
event
)
=>
new
Promise
(
resolve
=>
$input
.
one
(
event
,
resolve
));
const
parseAvatar
=
element
=>
const
waitForEvent
=
(
$input
,
event
)
=>
new
Promise
(
(
resolve
)
=>
$input
.
one
(
event
,
resolve
));
const
parseAvatar
=
(
element
)
=>
element
.
classList
.
contains
(
'
identicon
'
)
?
null
:
element
.
getAttribute
(
'
src
'
);
const
select2Container
=
()
=>
document
.
querySelector
(
'
.select2-container
'
);
const
select2DropdownOptions
=
()
=>
document
.
querySelectorAll
(
'
#select2-drop .user-result
'
);
const
select2DropdownItems
=
()
=>
Array
.
prototype
.
map
.
call
(
select2DropdownOptions
(),
element
=>
{
Array
.
prototype
.
map
.
call
(
select2DropdownOptions
(),
(
element
)
=>
{
const
isGroup
=
element
.
classList
.
contains
(
'
group-result
'
);
const
avatar
=
parseAvatar
(
element
.
querySelector
(
'
.avatar
'
));
...
...
@@ -92,7 +92,7 @@ describe('Approvals ApproversSelect', () => {
expect
(
select2Container
()).
not
.
toBe
(
null
);
});
it
(
'
queries and displays groups and users
'
,
async
done
=>
{
it
(
'
queries and displays groups and users
'
,
async
(
done
)
=>
{
await
factory
();
const
expected
=
TEST_GROUPS
.
concat
(
TEST_USERS
)
...
...
@@ -114,7 +114,7 @@ describe('Approvals ApproversSelect', () => {
describe
(
'
with search term
'
,
()
=>
{
const
term
=
'
lorem
'
;
beforeEach
(
async
done
=>
{
beforeEach
(
async
(
done
)
=>
{
await
factory
();
waitForEvent
(
$input
,
'
select2-loaded
'
)
...
...
@@ -140,7 +140,7 @@ describe('Approvals ApproversSelect', () => {
const
skipGroupIds
=
[
7
,
8
];
const
skipUserIds
=
[
9
,
10
];
beforeEach
(
async
done
=>
{
beforeEach
(
async
(
done
)
=>
{
await
factory
({
propsData
:
{
skipGroupIds
,
...
...
@@ -170,7 +170,7 @@ describe('Approvals ApproversSelect', () => {
});
});
it
(
'
emits input when data changes
'
,
async
done
=>
{
it
(
'
emits input when data changes
'
,
async
(
done
)
=>
{
await
factory
();
const
expectedFinal
=
[
...
...
ee/spec/frontend/approvals/components/branches_select_spec.js
View file @
7f4e951c
...
...
@@ -12,11 +12,11 @@ const TEST_PROTECTED_BRANCHES = [
{
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
waitForEvent
=
(
$input
,
event
)
=>
new
Promise
(
(
resolve
)
=>
$input
.
one
(
event
,
resolve
));
const
select2Container
=
()
=>
document
.
querySelector
(
'
.select2-container
'
);
const
select2DropdownOptions
=
()
=>
document
.
querySelectorAll
(
'
.result-name
'
);
const
branchNames
=
()
=>
TEST_BRANCHES_SELECTIONS
.
map
(
branch
=>
branch
.
name
);
const
protectedBranchNames
=
()
=>
TEST_PROTECTED_BRANCHES
.
map
(
branch
=>
branch
.
name
);
const
branchNames
=
()
=>
TEST_BRANCHES_SELECTIONS
.
map
(
(
branch
)
=>
branch
.
name
);
const
protectedBranchNames
=
()
=>
TEST_PROTECTED_BRANCHES
.
map
(
(
branch
)
=>
branch
.
name
);
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
...
...
@@ -64,12 +64,12 @@ describe('Branches Select', () => {
expect
(
select2Container
()).
not
.
toBe
(
null
);
});
it
(
'
displays all the protected branches and any branch
'
,
async
done
=>
{
it
(
'
displays all the protected branches and any branch
'
,
async
(
done
)
=>
{
await
createComponent
();
waitForEvent
(
$input
,
'
select2-loaded
'
)
.
then
(()
=>
{
const
nodeList
=
select2DropdownOptions
();
const
names
=
[...
nodeList
].
map
(
el
=>
el
.
textContent
);
const
names
=
[...
nodeList
].
map
(
(
el
)
=>
el
.
textContent
);
expect
(
names
).
toEqual
(
branchNames
());
})
...
...
@@ -83,7 +83,7 @@ describe('Branches Select', () => {
return
createComponent
();
});
it
(
'
fetches protected branches with search term
'
,
done
=>
{
it
(
'
fetches protected branches with search term
'
,
(
done
)
=>
{
const
term
=
'
lorem
'
;
waitForEvent
(
$input
,
'
select2-loaded
'
)
.
then
(()
=>
{})
...
...
@@ -95,11 +95,11 @@ describe('Branches Select', () => {
expect
(
Api
.
projectProtectedBranches
).
toHaveBeenCalledWith
(
TEST_PROJECT_ID
,
term
);
});
it
(
'
fetches protected branches with no any branch if there is search
'
,
done
=>
{
it
(
'
fetches protected branches with no any branch if there is search
'
,
(
done
)
=>
{
waitForEvent
(
$input
,
'
select2-loaded
'
)
.
then
(()
=>
{
const
nodeList
=
select2DropdownOptions
();
const
names
=
[...
nodeList
].
map
(
el
=>
el
.
textContent
);
const
names
=
[...
nodeList
].
map
(
(
el
)
=>
el
.
textContent
);
expect
(
names
).
toEqual
(
protectedBranchNames
());
})
...
...
@@ -108,11 +108,11 @@ describe('Branches Select', () => {
search
(
'
master
'
);
});
it
(
'
fetches protected branches with any branch if search contains term "any"
'
,
done
=>
{
it
(
'
fetches protected branches with any branch if search contains term "any"
'
,
(
done
)
=>
{
waitForEvent
(
$input
,
'
select2-loaded
'
)
.
then
(()
=>
{
const
nodeList
=
select2DropdownOptions
();
const
names
=
[...
nodeList
].
map
(
el
=>
el
.
textContent
);
const
names
=
[...
nodeList
].
map
(
(
el
)
=>
el
.
textContent
);
expect
(
names
).
toEqual
(
branchNames
());
})
...
...
@@ -122,7 +122,7 @@ describe('Branches Select', () => {
});
});
it
(
'
emits input when data changes
'
,
async
done
=>
{
it
(
'
emits input when data changes
'
,
async
(
done
)
=>
{
await
createComponent
();
const
selectedIndex
=
1
;
...
...
ee/spec/frontend/approvals/components/license_compliance/index_spec.js
View file @
7f4e951c
...
...
@@ -55,7 +55,7 @@ describe('EE Approvals LicenseCompliance', () => {
wrapper
=
null
;
});
const
findByHrefAttribute
=
href
=>
wrapper
.
find
(
`[href="
${
href
}
"]`
);
const
findByHrefAttribute
=
(
href
)
=>
wrapper
.
find
(
`[href="
${
href
}
"]`
);
const
findOpenModalButton
=
()
=>
wrapper
.
find
(
'
button
'
);
const
findLoadingIndicator
=
()
=>
wrapper
.
find
(
'
[aria-label="loading"]
'
);
const
findInformationIcon
=
()
=>
wrapper
.
find
(
GlIcon
);
...
...
ee/spec/frontend/approvals/components/license_compliance/modal_spec.js
View file @
7f4e951c
...
...
@@ -72,7 +72,7 @@ describe('EE Approvals LicenseCompliance Modal', () => {
wrapper
=
null
;
});
const
findByHref
=
href
=>
wrapper
.
find
(
`[href="
${
href
}
"`
);
const
findByHref
=
(
href
)
=>
wrapper
.
find
(
`[href="
${
href
}
"`
);
const
findModal
=
()
=>
wrapper
.
find
(
GlModalVuex
);
const
findRuleForm
=
()
=>
wrapper
.
find
(
mocks
.
RuleForm
);
const
findInformationIcon
=
()
=>
wrapper
.
find
(
'
[name="question"]
'
);
...
...
ee/spec/frontend/approvals/components/mr_edit/mr_rules_hidden_inputs_spec.js
View file @
7f4e951c
...
...
@@ -49,7 +49,7 @@ describe('EE Approvlas MRRulesHiddenInputs', () => {
});
const
findHiddenInputs
=
()
=>
wrapper
.
findAll
(
'
input[type=hidden]
'
).
wrappers
.
map
(
x
=>
({
wrapper
.
findAll
(
'
input[type=hidden]
'
).
wrappers
.
map
(
(
x
)
=>
({
name
:
x
.
attributes
(
'
name
'
),
value
:
x
.
element
.
value
,
}));
...
...
@@ -137,7 +137,7 @@ describe('EE Approvlas MRRulesHiddenInputs', () => {
it
(
'
renders empty users input
'
,
()
=>
{
factory
();
expect
(
findHiddenInputs
().
filter
(
x
=>
x
.
name
===
INPUT_USER_IDS
)).
toEqual
([
expect
(
findHiddenInputs
().
filter
(
(
x
)
=>
x
.
name
===
INPUT_USER_IDS
)).
toEqual
([
{
name
:
INPUT_USER_IDS
,
value
:
''
},
]);
});
...
...
@@ -151,7 +151,7 @@ describe('EE Approvlas MRRulesHiddenInputs', () => {
it
(
'
renders empty groups input
'
,
()
=>
{
factory
();
expect
(
findHiddenInputs
().
filter
(
x
=>
x
.
name
===
INPUT_GROUP_IDS
)).
toEqual
([
expect
(
findHiddenInputs
().
filter
(
(
x
)
=>
x
.
name
===
INPUT_GROUP_IDS
)).
toEqual
([
{
name
:
INPUT_GROUP_IDS
,
value
:
''
},
]);
});
...
...
@@ -165,7 +165,7 @@ describe('EE Approvlas MRRulesHiddenInputs', () => {
it
(
'
does render id input
'
,
()
=>
{
factory
();
expect
(
findHiddenInputs
().
map
(
x
=>
x
.
name
)).
toContain
(
INPUT_ID
);
expect
(
findHiddenInputs
().
map
(
(
x
)
=>
x
.
name
)).
toContain
(
INPUT_ID
);
});
describe
(
'
with source
'
,
()
=>
{
...
...
ee/spec/frontend/approvals/components/mr_edit/mr_rules_spec.js
View file @
7f4e951c
...
...
@@ -31,12 +31,12 @@ describe('EE Approvals MRRules', () => {
});
};
const
findHeaders
=
()
=>
wrapper
.
findAll
(
'
thead th
'
).
wrappers
.
map
(
x
=>
x
.
text
());
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
findRuleControls
=
()
=>
wrapper
.
find
(
'
td.js-controls
'
).
find
(
RuleControls
);
const
callTargetBranchHandler
=
MutationObserverSpy
=>
{
const
callTargetBranchHandler
=
(
MutationObserverSpy
)
=>
{
const
onTargetBranchMutationHandler
=
MutationObserverSpy
.
mock
.
calls
[
0
][
0
];
return
onTargetBranchMutationHandler
();
};
...
...
@@ -45,7 +45,7 @@ describe('EE Approvals MRRules', () => {
OriginalMutationObserver
=
global
.
MutationObserver
;
global
.
MutationObserver
=
jest
.
fn
()
.
mockImplementation
(
args
=>
new
OriginalMutationObserver
(
args
));
.
mockImplementation
(
(
args
)
=>
new
OriginalMutationObserver
(
args
));
store
=
createStoreOptions
(
MREditModule
());
store
.
modules
.
approvals
.
state
=
{
...
...
@@ -157,7 +157,7 @@ describe('EE Approvals MRRules', () => {
factory
();
const
anyApproverCount
=
store
.
modules
.
approvals
.
state
.
rules
.
filter
(
rule
=>
rule
.
ruleType
===
'
any_approver
'
,
(
rule
)
=>
rule
.
ruleType
===
'
any_approver
'
,
);
expect
(
anyApproverCount
).
toHaveLength
(
1
);
...
...
ee/spec/frontend/approvals/components/project_settings/project_rules_spec.js
View file @
7f4e951c
...
...
@@ -16,7 +16,7 @@ localVue.use(Vuex);
const
findCell
=
(
tr
,
name
)
=>
tr
.
find
(
`td.js-
${
name
}
`
);
const
getRowData
=
tr
=>
{
const
getRowData
=
(
tr
)
=>
{
const
name
=
findCell
(
tr
,
'
name
'
);
const
members
=
findCell
(
tr
,
'
members
'
);
const
approvalsRequired
=
findCell
(
tr
,
'
approvals-required
'
);
...
...
@@ -61,7 +61,7 @@ describe('Approvals ProjectRules', () => {
const
data
=
rows
.
wrappers
.
map
(
getRowData
);
expect
(
data
).
toEqual
(
TEST_RULES
.
filter
((
rule
,
index
)
=>
index
!==
0
).
map
(
rule
=>
({
TEST_RULES
.
filter
((
rule
,
index
)
=>
index
!==
0
).
map
(
(
rule
)
=>
({
name
:
rule
.
name
,
approvers
:
rule
.
approvers
,
approvalsRequired
:
rule
.
approvalsRequired
,
...
...
@@ -74,7 +74,7 @@ describe('Approvals ProjectRules', () => {
it
(
'
should always have any_approver rule
'
,
()
=>
{
factory
();
const
hasAnyApproverRule
=
store
.
modules
.
approvals
.
state
.
rules
.
some
(
rule
=>
rule
.
ruleType
===
'
any_approver
'
,
(
rule
)
=>
rule
.
ruleType
===
'
any_approver
'
,
);
expect
(
hasAnyApproverRule
).
toBe
(
true
);
...
...
@@ -133,7 +133,7 @@ describe('Approvals ProjectRules', () => {
describe
.
each
([
true
,
false
])(
'
when the approvalSuggestions feature flag is %p
'
,
approvalSuggestions
=>
{
(
approvalSuggestions
)
=>
{
beforeEach
(()
=>
{
const
rules
=
createProjectRules
();
rules
[
0
].
name
=
'
Vulnerability-Check
'
;
...
...
ee/spec/frontend/approvals/components/rule_form_spec.js
View file @
7f4e951c
...
...
@@ -41,7 +41,7 @@ const nameTakenError = {
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
const
addType
=
type
=>
x
=>
Object
.
assign
(
x
,
{
type
});
const
addType
=
(
type
)
=>
(
x
)
=>
Object
.
assign
(
x
,
{
type
});
describe
(
'
EE Approvals RuleForm
'
,
()
=>
{
let
wrapper
;
...
...
@@ -88,7 +88,7 @@ describe('EE Approvals RuleForm', () => {
beforeEach
(()
=>
{
store
=
createStoreOptions
(
projectSettingsModule
(),
{
projectId
:
TEST_PROJECT_ID
});
[
'
postRule
'
,
'
putRule
'
,
'
deleteRule
'
,
'
putFallbackRule
'
].
forEach
(
actionName
=>
{
[
'
postRule
'
,
'
putRule
'
,
'
deleteRule
'
,
'
putFallbackRule
'
].
forEach
(
(
actionName
)
=>
{
jest
.
spyOn
(
store
.
modules
.
approvals
.
actions
,
actionName
).
mockImplementation
(()
=>
{});
});
...
...
@@ -114,7 +114,7 @@ describe('EE Approvals RuleForm', () => {
});
it
(
'
on load, it populates initial protected branch ids
'
,
()
=>
{
expect
(
wrapper
.
vm
.
branches
).
toEqual
(
TEST_PROTECTED_BRANCHES
.
map
(
x
=>
x
.
id
));
expect
(
wrapper
.
vm
.
branches
).
toEqual
(
TEST_PROTECTED_BRANCHES
.
map
(
(
x
)
=>
x
.
id
));
});
});
...
...
@@ -128,14 +128,14 @@ describe('EE Approvals RuleForm', () => {
it
(
'
at first, shows no validation
'
,
()
=>
{
const
inputs
=
findValidationsWithBranch
();
const
invalidInputs
=
inputs
.
filter
(
x
=>
!
x
.
isValid
);
const
feedbacks
=
inputs
.
map
(
x
=>
x
.
feedback
);
const
invalidInputs
=
inputs
.
filter
(
(
x
)
=>
!
x
.
isValid
);
const
feedbacks
=
inputs
.
map
(
(
x
)
=>
x
.
feedback
);
expect
(
invalidInputs
.
length
).
toBe
(
0
);
expect
(
feedbacks
.
every
(
str
=>
!
str
.
length
)).
toBe
(
true
);
expect
(
feedbacks
.
every
(
(
str
)
=>
!
str
.
length
)).
toBe
(
true
);
});
it
(
'
on submit, shows branches validation
'
,
done
=>
{
it
(
'
on submit, shows branches validation
'
,
(
done
)
=>
{
wrapper
.
vm
.
branches
=
[
'
3
'
];
wrapper
.
vm
.
submit
();
...
...
@@ -154,9 +154,9 @@ describe('EE Approvals RuleForm', () => {
it
(
'
on submit with data, posts rule
'
,
()
=>
{
const
users
=
[
1
,
2
];
const
groups
=
[
2
,
3
];
const
userRecords
=
users
.
map
(
id
=>
({
id
,
type
:
TYPE_USER
}));
const
groupRecords
=
groups
.
map
(
id
=>
({
id
,
type
:
TYPE_GROUP
}));
const
branches
=
TEST_PROTECTED_BRANCHES
.
map
(
x
=>
x
.
id
);
const
userRecords
=
users
.
map
(
(
id
)
=>
({
id
,
type
:
TYPE_USER
}));
const
groupRecords
=
groups
.
map
(
(
id
)
=>
({
id
,
type
:
TYPE_GROUP
}));
const
branches
=
TEST_PROTECTED_BRANCHES
.
map
(
(
x
)
=>
x
.
id
);
const
expected
=
{
id
:
null
,
name
:
'
Lorem
'
,
...
...
@@ -188,11 +188,11 @@ describe('EE Approvals RuleForm', () => {
it
(
'
at first, shows no validation
'
,
()
=>
{
const
inputs
=
findValidations
();
const
invalidInputs
=
inputs
.
filter
(
x
=>
!
x
.
isValid
);
const
feedbacks
=
inputs
.
map
(
x
=>
x
.
feedback
);
const
invalidInputs
=
inputs
.
filter
(
(
x
)
=>
!
x
.
isValid
);
const
feedbacks
=
inputs
.
map
(
(
x
)
=>
x
.
feedback
);
expect
(
invalidInputs
.
length
).
toBe
(
0
);
expect
(
feedbacks
.
every
(
str
=>
!
str
.
length
)).
toBe
(
true
);
expect
(
feedbacks
.
every
(
(
str
)
=>
!
str
.
length
)).
toBe
(
true
);
});
it
(
'
on submit, does not dispatch action
'
,
()
=>
{
...
...
@@ -201,7 +201,7 @@ describe('EE Approvals RuleForm', () => {
expect
(
actions
.
postRule
).
not
.
toHaveBeenCalled
();
});
it
(
'
on submit, shows name validation
'
,
done
=>
{
it
(
'
on submit, shows name validation
'
,
(
done
)
=>
{
findNameInput
().
setValue
(
''
);
wrapper
.
vm
.
submit
();
...
...
@@ -218,7 +218,7 @@ describe('EE Approvals RuleForm', () => {
.
catch
(
done
.
fail
);
});
it
(
'
on submit, shows approvalsRequired validation
'
,
done
=>
{
it
(
'
on submit, shows approvalsRequired validation
'
,
(
done
)
=>
{
findApprovalsRequiredInput
().
setValue
(
-
1
);
wrapper
.
vm
.
submit
();
...
...
@@ -235,7 +235,7 @@ describe('EE Approvals RuleForm', () => {
.
catch
(
done
.
fail
);
});
it
(
'
on submit, shows approvers validation
'
,
done
=>
{
it
(
'
on submit, shows approvers validation
'
,
(
done
)
=>
{
wrapper
.
vm
.
approvers
=
[];
wrapper
.
vm
.
submit
();
...
...
@@ -254,9 +254,9 @@ describe('EE Approvals RuleForm', () => {
describe
(
'
with valid data
'
,
()
=>
{
const
users
=
[
1
,
2
];
const
groups
=
[
2
,
3
];
const
userRecords
=
users
.
map
(
id
=>
({
id
,
type
:
TYPE_USER
}));
const
groupRecords
=
groups
.
map
(
id
=>
({
id
,
type
:
TYPE_GROUP
}));
const
branches
=
TEST_PROTECTED_BRANCHES
.
map
(
x
=>
x
.
id
);
const
userRecords
=
users
.
map
(
(
id
)
=>
({
id
,
type
:
TYPE_USER
}));
const
groupRecords
=
groups
.
map
(
(
id
)
=>
({
id
,
type
:
TYPE_GROUP
}));
const
branches
=
TEST_PROTECTED_BRANCHES
.
map
(
(
x
)
=>
x
.
id
);
const
expected
=
{
id
:
null
,
name
:
'
Lorem
'
,
...
...
@@ -333,10 +333,10 @@ describe('EE Approvals RuleForm', () => {
});
describe
(
'
with valid data
'
,
()
=>
{
const
userRecords
=
TEST_RULE
.
users
.
map
(
x
=>
({
...
x
,
type
:
TYPE_USER
}));
const
groupRecords
=
TEST_RULE
.
groups
.
map
(
x
=>
({
...
x
,
type
:
TYPE_GROUP
}));
const
users
=
userRecords
.
map
(
x
=>
x
.
id
);
const
groups
=
groupRecords
.
map
(
x
=>
x
.
id
);
const
userRecords
=
TEST_RULE
.
users
.
map
(
(
x
)
=>
({
...
x
,
type
:
TYPE_USER
}));
const
groupRecords
=
TEST_RULE
.
groups
.
map
(
(
x
)
=>
({
...
x
,
type
:
TYPE_GROUP
}));
const
users
=
userRecords
.
map
(
(
x
)
=>
x
.
id
);
const
groups
=
groupRecords
.
map
(
(
x
)
=>
x
.
id
);
const
expected
=
{
...
TEST_RULE
,
...
...
@@ -392,7 +392,7 @@ describe('EE Approvals RuleForm', () => {
});
describe
(
'
with empty name and empty approvers
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
wrapper
.
vm
.
submit
();
localVue
.
nextTick
(
done
);
});
...
...
@@ -408,12 +408,12 @@ describe('EE Approvals RuleForm', () => {
});
it
(
'
does not show any validation errors
'
,
()
=>
{
expect
(
findValidations
().
every
(
x
=>
x
.
isValid
)).
toBe
(
true
);
expect
(
findValidations
().
every
(
(
x
)
=>
x
.
isValid
)).
toBe
(
true
);
});
});
describe
(
'
with name and empty approvers
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
wrapper
.
vm
.
name
=
'
Lorem
'
;
wrapper
.
vm
.
submit
();
...
...
@@ -430,7 +430,7 @@ describe('EE Approvals RuleForm', () => {
});
describe
(
'
with empty name and approvers
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
wrapper
.
vm
.
approvers
=
TEST_APPROVERS
;
wrapper
.
vm
.
submit
();
...
...
@@ -447,7 +447,7 @@ describe('EE Approvals RuleForm', () => {
});
describe
(
'
with name and approvers
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
wrapper
.
vm
.
approvers
=
[{
id
:
7
,
type
:
TYPE_USER
}];
wrapper
.
vm
.
name
=
'
Lorem
'
;
wrapper
.
vm
.
submit
();
...
...
@@ -498,7 +498,7 @@ describe('EE Approvals RuleForm', () => {
describe
(
'
and hidden groups removed
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
.
vm
.
approvers
=
wrapper
.
vm
.
approvers
.
filter
(
x
=>
x
.
type
!==
TYPE_HIDDEN_GROUPS
);
wrapper
.
vm
.
approvers
=
wrapper
.
vm
.
approvers
.
filter
(
(
x
)
=>
x
.
type
!==
TYPE_HIDDEN_GROUPS
);
});
it
(
'
on submit, removes hidden groups
'
,
()
=>
{
...
...
@@ -529,7 +529,7 @@ describe('EE Approvals RuleForm', () => {
expect
(
findApproversList
()
.
props
(
'
value
'
)
.
every
(
x
=>
x
.
type
!==
TYPE_HIDDEN_GROUPS
),
.
every
(
(
x
)
=>
x
.
type
!==
TYPE_HIDDEN_GROUPS
),
).
toBe
(
true
);
});
});
...
...
@@ -656,7 +656,7 @@ describe('EE Approvals RuleForm', () => {
expect
.
objectContaining
({
name
:
expectedNameSubmitted
,
approvalsRequired
:
TEST_APPROVALS_REQUIRED
,
users
:
TEST_APPROVERS
.
map
(
x
=>
x
.
id
),
users
:
TEST_APPROVERS
.
map
(
(
x
)
=>
x
.
id
),
}),
);
});
...
...
@@ -712,7 +712,7 @@ describe('EE Approvals RuleForm', () => {
});
describe
(
'
with name and approvers
'
,
()
=>
{
beforeEach
(
done
=>
{
beforeEach
(
(
done
)
=>
{
wrapper
.
vm
.
name
=
inputName
;
wrapper
.
vm
.
approvers
=
TEST_APPROVERS
;
wrapper
.
vm
.
submit
();
...
...
@@ -727,7 +727,7 @@ describe('EE Approvals RuleForm', () => {
id
:
TEST_RULE
.
id
,
name
:
expectedNameSubmitted
,
approvalsRequired
:
TEST_APPROVALS_REQUIRED
,
users
:
TEST_APPROVERS
.
map
(
x
=>
x
.
id
),
users
:
TEST_APPROVERS
.
map
(
(
x
)
=>
x
.
id
),
}),
);
});
...
...
ee/spec/frontend/approvals/stores/modules/mr_edit/actions_spec.js
View file @
7f4e951c
...
...
@@ -4,7 +4,7 @@ import testAction from 'helpers/vuex_action_helper';
describe
(
'
Approval MR edit module actions
'
,
()
=>
{
describe
(
'
setTargetBranch
'
,
()
=>
{
it
(
'
commits SET_TARGET_BRANCH
'
,
done
=>
{
it
(
'
commits SET_TARGET_BRANCH
'
,
(
done
)
=>
{
testAction
(
actions
.
setTargetBranch
,
'
master
'
,
...
...
@@ -17,7 +17,7 @@ describe('Approval MR edit module actions', () => {
});
describe
(
'
undoRulesChange
'
,
()
=>
{
it
(
'
commits UNDO_RULES
'
,
done
=>
{
it
(
'
commits UNDO_RULES
'
,
(
done
)
=>
{
testAction
(
actions
.
undoRulesChange
,
null
,
{},
[{
type
:
types
.
UNDO_RULES
}],
[],
done
);
});
});
...
...
ee/spec/frontend/approvals/stores/modules/project_settings/actions_spec.js
View file @
7f4e951c
...
...
@@ -101,7 +101,7 @@ describe('EE approvals project settings module actions', () => {
{
type
:
'
receiveRulesSuccess
'
,
payload
:
mapApprovalSettingsResponse
(
data
)
},
],
()
=>
{
expect
(
mock
.
history
.
get
.
map
(
x
=>
x
.
url
)).
toEqual
([
TEST_SETTINGS_PATH
]);
expect
(
mock
.
history
.
get
.
map
(
(
x
)
=>
x
.
url
)).
toEqual
([
TEST_SETTINGS_PATH
]);
},
);
});
...
...
ee/spec/frontend/audit_events/components/audit_events_app_spec.js
View file @
7f4e951c
...
...
@@ -19,7 +19,7 @@ describe('AuditEventsApp', () => {
let
store
;
const
events
=
[{
foo
:
'
bar
'
}];
const
filterTokenOptions
=
AVAILABLE_TOKEN_TYPES
.
map
(
type
=>
({
type
}));
const
filterTokenOptions
=
AVAILABLE_TOKEN_TYPES
.
map
(
(
type
)
=>
({
type
}));
const
exportUrl
=
'
http://example.com/audit_log_reports.csv
'
;
const
initComponent
=
(
props
=
{})
=>
{
...
...
ee/spec/frontend/audit_events/components/sorting_field_spec.js
View file @
7f4e951c
...
...
@@ -12,7 +12,7 @@ describe('SortingField component', () => {
};
const
getCheckedOptions
=
()
=>
wrapper
.
findAll
(
GlDropdownItem
).
filter
(
item
=>
item
.
props
().
isChecked
);
wrapper
.
findAll
(
GlDropdownItem
).
filter
(
(
item
)
=>
item
.
props
().
isChecked
);
beforeEach
(()
=>
{
initComponent
();
...
...
ee/spec/frontend/audit_events/components/tokens/audit_filter_token_spec.js
View file @
7f4e951c
...
...
@@ -19,7 +19,7 @@ describe('AuditFilterToken', () => {
];
const
findFilteredSearchToken
=
()
=>
wrapper
.
find
(
'
#filtered-search-token
'
);
const
findLoadingIcon
=
type
=>
wrapper
.
find
(
type
).
find
(
GlLoadingIcon
);
const
findLoadingIcon
=
(
type
)
=>
wrapper
.
find
(
type
).
find
(
GlLoadingIcon
);
const
tokenMethods
=
{
fetchItem
:
jest
.
fn
().
mockResolvedValue
(
item
),
...
...
ee/spec/frontend/billings/helpers.js
View file @
7f4e951c
import
subscriptionState
from
'
ee/billings/subscriptions/store/state
'
;
export
const
resetStore
=
store
=>
{
export
const
resetStore
=
(
store
)
=>
{
const
newState
=
{
subscription
:
subscriptionState
(),
};
...
...
ee/spec/frontend/billings/seat_usage/components/subscription_seats_spec.js
View file @
7f4e951c
...
...
@@ -55,7 +55,7 @@ describe('Subscription Seats', () => {
const
findPageHeading
=
()
=>
wrapper
.
find
(
'
[data-testid="heading"]
'
);
const
findPagination
=
()
=>
wrapper
.
find
(
GlPagination
);
const
serializeUser
=
rowWrapper
=>
{
const
serializeUser
=
(
rowWrapper
)
=>
{
const
avatarLink
=
rowWrapper
.
find
(
GlAvatarLink
);
const
avatarLabeled
=
rowWrapper
.
find
(
GlAvatarLabeled
);
...
...
@@ -72,7 +72,7 @@ describe('Subscription Seats', () => {
};
};
const
serializeTableRow
=
rowWrapper
=>
{
const
serializeTableRow
=
(
rowWrapper
)
=>
{
const
emailWrapper
=
rowWrapper
.
find
(
'
[data-testid="email"]
'
);
return
{
...
...
@@ -82,7 +82,7 @@ describe('Subscription Seats', () => {
};
};
const
findSerializedTable
=
tableWrapper
=>
{
const
findSerializedTable
=
(
tableWrapper
)
=>
{
return
tableWrapper
.
findAll
(
'
tbody tr
'
).
wrappers
.
map
(
serializeTableRow
);
};
...
...
@@ -141,7 +141,7 @@ describe('Subscription Seats', () => {
describe
(
'
pagination
'
,
()
=>
{
it
.
each
([
null
,
NaN
,
undefined
,
'
a string
'
,
false
])(
'
will not render given %s for currentPage
'
,
value
=>
{
(
value
)
=>
{
wrapper
=
createComponent
({
initialState
:
{
page
:
value
,
...
...
ee/spec/frontend/billings/seat_usage/store/actions_spec.js
View file @
7f4e951c
...
...
@@ -100,7 +100,7 @@ describe('seats actions', () => {
});
describe
(
'
receiveBillableMembersListError
'
,
()
=>
{
it
(
'
should commit the error mutation
'
,
done
=>
{
it
(
'
should commit the error mutation
'
,
(
done
)
=>
{
testAction
(
actions
.
receiveBillableMembersListError
,
{},
...
...
ee/spec/frontend/billings/subscriptions/components/subscription_table_row_spec.js
View file @
7f4e951c
...
...
@@ -76,7 +76,7 @@ describe('subscription table row', () => {
const
findContentCells
=
()
=>
wrapper
.
findAll
(
'
[data-testid="content-cell"]
'
);
const
findHeaderIcon
=
()
=>
findHeaderCell
().
find
(
GlIcon
);
const
findColumnLabelAndTitle
=
columnWrapper
=>
{
const
findColumnLabelAndTitle
=
(
columnWrapper
)
=>
{
const
label
=
columnWrapper
.
find
(
'
[data-testid="property-label"]
'
);
const
value
=
columnWrapper
.
find
(
'
[data-testid="property-value"]
'
);
...
...
@@ -111,7 +111,7 @@ describe('subscription table row', () => {
});
it
(
`should not render a hidden column`
,
()
=>
{
const
hiddenColIdx
=
COLUMNS
.
find
(
c
=>
!
c
.
display
);
const
hiddenColIdx
=
COLUMNS
.
find
(
(
c
)
=>
!
c
.
display
);
const
hiddenCol
=
findContentCells
().
at
(
hiddenColIdx
);
expect
(
hiddenCol
).
toBe
(
undefined
);
...
...
ee/spec/frontend/billings/subscriptions/store/mutations_spec.js
View file @
7f4e951c
...
...
@@ -39,7 +39,7 @@ describe('EE billings subscription module mutations', () => {
});
describe
(
types
.
RECEIVE_SUBSCRIPTION_SUCCESS
,
()
=>
{
const
getColumnValues
=
columns
=>
const
getColumnValues
=
(
columns
)
=>
columns
.
reduce
(
(
acc
,
{
id
,
value
})
=>
({
...
acc
,
...
...
@@ -47,7 +47,7 @@ describe('EE billings subscription module mutations', () => {
}),
{},
);
const
getStateTableValues
=
key
=>
const
getStateTableValues
=
(
key
)
=>
state
.
tables
[
key
].
rows
.
map
(({
columns
})
=>
getColumnValues
(
columns
));
describe
.
each
`
...
...
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