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
6a0d815d
Commit
6a0d815d
authored
Dec 29, 2021
by
Illya Klymov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate setData calls in vue specs
* add lint against setData * add eslint-ignore for existing cases
parent
ccf33f48
Changes
85
Hide whitespace changes
Inline
Side-by-side
Showing
85 changed files
with
430 additions
and
0 deletions
+430
-0
.eslintrc.yml
.eslintrc.yml
+4
-0
spec/frontend/alerts_settings/components/alerts_settings_form_spec.js
...d/alerts_settings/components/alerts_settings_form_spec.js
+10
-0
spec/frontend/analytics/shared/components/projects_dropdown_filter_spec.js
...lytics/shared/components/projects_dropdown_filter_spec.js
+4
-0
spec/frontend/blob/components/blob_edit_header_spec.js
spec/frontend/blob/components/blob_edit_header_spec.js
+2
-0
spec/frontend/boards/components/boards_selector_spec.js
spec/frontend/boards/components/boards_selector_spec.js
+12
-0
spec/frontend/ci_lint/components/ci_lint_spec.js
spec/frontend/ci_lint/components/ci_lint_spec.js
+2
-0
spec/frontend/clusters/forms/components/integration_form_spec.js
...ontend/clusters/forms/components/integration_form_spec.js
+4
-0
spec/frontend/clusters_list/components/clusters_spec.js
spec/frontend/clusters_list/components/clusters_spec.js
+2
-0
spec/frontend/commit/pipelines/pipelines_table_spec.js
spec/frontend/commit/pipelines/pipelines_table_spec.js
+2
-0
spec/frontend/create_cluster/components/cluster_form_dropdown_spec.js
...d/create_cluster/components/cluster_form_dropdown_spec.js
+2
-0
spec/frontend/create_cluster/eks_cluster/components/service_credentials_form_spec.js
...r/eks_cluster/components/service_credentials_form_spec.js
+6
-0
spec/frontend/create_cluster/gke_cluster/components/gke_machine_type_dropdown_spec.js
.../gke_cluster/components/gke_machine_type_dropdown_spec.js
+2
-0
spec/frontend/create_cluster/gke_cluster/components/gke_project_id_dropdown_spec.js
...er/gke_cluster/components/gke_project_id_dropdown_spec.js
+6
-0
spec/frontend/create_cluster/gke_cluster/components/gke_zone_dropdown_spec.js
..._cluster/gke_cluster/components/gke_zone_dropdown_spec.js
+2
-0
spec/frontend/cycle_analytics/value_stream_metrics_spec.js
spec/frontend/cycle_analytics/value_stream_metrics_spec.js
+2
-0
spec/frontend/deploy_freeze/components/timezone_dropdown_spec.js
...ontend/deploy_freeze/components/timezone_dropdown_spec.js
+2
-0
spec/frontend/design_management/components/design_overlay_spec.js
...ntend/design_management/components/design_overlay_spec.js
+10
-0
spec/frontend/design_management/components/design_presentation_spec.js
.../design_management/components/design_presentation_spec.js
+2
-0
spec/frontend/design_management/components/image_spec.js
spec/frontend/design_management/components/image_spec.js
+2
-0
spec/frontend/design_management/components/toolbar/design_navigation_spec.js
...n_management/components/toolbar/design_navigation_spec.js
+4
-0
spec/frontend/design_management/components/toolbar/index_spec.js
...ontend/design_management/components/toolbar/index_spec.js
+2
-0
spec/frontend/design_management/components/upload/design_version_dropdown_spec.js
...agement/components/upload/design_version_dropdown_spec.js
+2
-0
spec/frontend/design_management/pages/design/index_spec.js
spec/frontend/design_management/pages/design/index_spec.js
+2
-0
spec/frontend/design_management/pages/index_spec.js
spec/frontend/design_management/pages/index_spec.js
+6
-0
spec/frontend/emoji/components/category_spec.js
spec/frontend/emoji/components/category_spec.js
+2
-0
spec/frontend/emoji/components/emoji_list_spec.js
spec/frontend/emoji/components/emoji_list_spec.js
+2
-0
spec/frontend/error_tracking/components/error_details_spec.js
.../frontend/error_tracking/components/error_details_spec.js
+28
-0
spec/frontend/error_tracking/components/error_tracking_list_spec.js
...end/error_tracking/components/error_tracking_list_spec.js
+2
-0
spec/frontend/ide/components/preview/clientside_spec.js
spec/frontend/ide/components/preview/clientside_spec.js
+20
-0
spec/frontend/ide/components/terminal/terminal_spec.js
spec/frontend/ide/components/terminal/terminal_spec.js
+2
-0
spec/frontend/invite_members/components/invite_members_modal_spec.js
...nd/invite_members/components/invite_members_modal_spec.js
+12
-0
spec/frontend/issuable/components/related_issuable_item_spec.js
...rontend/issuable/components/related_issuable_item_spec.js
+2
-0
spec/frontend/issues/new/components/title_suggestions_spec.js
.../frontend/issues/new/components/title_suggestions_spec.js
+14
-0
spec/frontend/jobs/components/table/job_table_app_spec.js
spec/frontend/jobs/components/table/job_table_app_spec.js
+2
-0
spec/frontend/monitoring/components/charts/time_series_spec.js
...frontend/monitoring/components/charts/time_series_spec.js
+2
-0
spec/frontend/monitoring/components/dashboard_spec.js
spec/frontend/monitoring/components/dashboard_spec.js
+2
-0
spec/frontend/monitoring/components/dashboards_dropdown_spec.js
...rontend/monitoring/components/dashboards_dropdown_spec.js
+2
-0
spec/frontend/mr_popover/mr_popover_spec.js
spec/frontend/mr_popover/mr_popover_spec.js
+4
-0
spec/frontend/notes/components/comment_form_spec.js
spec/frontend/notes/components/comment_form_spec.js
+4
-0
spec/frontend/notes/components/note_form_spec.js
spec/frontend/notes/components/note_form_spec.js
+2
-0
spec/frontend/notifications/components/custom_notifications_modal_spec.js
...tifications/components/custom_notifications_modal_spec.js
+6
-0
spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/packages_list_spec.js
...registry/components/list/components/packages_list_spec.js
+8
-0
spec/frontend/profile/account/components/update_username_spec.js
...ontend/profile/account/components/update_username_spec.js
+2
-0
spec/frontend/projects/commits/components/author_select_spec.js
...rontend/projects/commits/components/author_select_spec.js
+10
-0
spec/frontend/projects/compare/components/revision_dropdown_legacy_spec.js
...jects/compare/components/revision_dropdown_legacy_spec.js
+2
-0
spec/frontend/repository/components/blob_content_viewer_spec.js
...rontend/repository/components/blob_content_viewer_spec.js
+2
-0
spec/frontend/repository/components/breadcrumbs_spec.js
spec/frontend/repository/components/breadcrumbs_spec.js
+8
-0
spec/frontend/repository/components/last_commit_spec.js
spec/frontend/repository/components/last_commit_spec.js
+2
-0
spec/frontend/repository/components/preview/index_spec.js
spec/frontend/repository/components/preview/index_spec.js
+6
-0
spec/frontend/repository/components/table/index_spec.js
spec/frontend/repository/components/table/index_spec.js
+2
-0
spec/frontend/repository/components/table/row_spec.js
spec/frontend/repository/components/table/row_spec.js
+2
-0
spec/frontend/repository/components/tree_content_spec.js
spec/frontend/repository/components/tree_content_spec.js
+8
-0
spec/frontend/repository/components/upload_blob_modal_spec.js
.../frontend/repository/components/upload_blob_modal_spec.js
+4
-0
spec/frontend/search/topbar/components/searchable_dropdown_spec.js
...tend/search/topbar/components/searchable_dropdown_spec.js
+4
-0
spec/frontend/sidebar/components/reviewers/uncollapsed_reviewer_list_spec.js
...ar/components/reviewers/uncollapsed_reviewer_list_spec.js
+8
-0
spec/frontend/sidebar/participants_spec.js
spec/frontend/sidebar/participants_spec.js
+8
-0
spec/frontend/snippets/components/snippet_blob_view_spec.js
spec/frontend/snippets/components/snippet_blob_view_spec.js
+2
-0
spec/frontend/snippets/components/snippet_header_spec.js
spec/frontend/snippets/components/snippet_header_spec.js
+2
-0
spec/frontend/static_site_editor/components/edit_area_spec.js
.../frontend/static_site_editor/components/edit_area_spec.js
+4
-0
spec/frontend/static_site_editor/rich_content_editor/modals/add_image/add_image_modal_spec.js
...h_content_editor/modals/add_image/add_image_modal_spec.js
+4
-0
spec/frontend/terraform/components/states_table_actions_spec.js
...rontend/terraform/components/states_table_actions_spec.js
+2
-0
spec/frontend/vue_mr_widget/components/approvals/approvals_spec.js
...tend/vue_mr_widget/components/approvals/approvals_spec.js
+2
-0
spec/frontend/vue_mr_widget/components/mr_widget_rebase_spec.js
...rontend/vue_mr_widget/components/mr_widget_rebase_spec.js
+2
-0
spec/frontend/vue_mr_widget/components/states/mr_widget_auto_merge_enabled_spec.js
...et/components/states/mr_widget_auto_merge_enabled_spec.js
+4
-0
spec/frontend/vue_mr_widget/components/states/mr_widget_commits_header_spec.js
...widget/components/states/mr_widget_commits_header_spec.js
+4
-0
spec/frontend/vue_mr_widget/components/states/mr_widget_conflicts_spec.js
...e_mr_widget/components/states/mr_widget_conflicts_spec.js
+2
-0
spec/frontend/vue_mr_widget/components/states/mr_widget_missing_branch_spec.js
...widget/components/states/mr_widget_missing_branch_spec.js
+2
-0
spec/frontend/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js
...widget/components/states/mr_widget_ready_to_merge_spec.js
+8
-0
spec/frontend/vue_mr_widget/components/terraform/mr_widget_terraform_container_spec.js
...omponents/terraform/mr_widget_terraform_container_spec.js
+2
-0
spec/frontend/vue_shared/alert_details/alert_details_spec.js
spec/frontend/vue_shared/alert_details/alert_details_spec.js
+2
-0
spec/frontend/vue_shared/alert_details/sidebar/alert_sidebar_assignees_spec.js
...red/alert_details/sidebar/alert_sidebar_assignees_spec.js
+6
-0
spec/frontend/vue_shared/components/chronic_duration_input_spec.js
...tend/vue_shared/components/chronic_duration_input_spec.js
+2
-0
spec/frontend/vue_shared/components/filtered_search_bar/filtered_search_bar_root_spec.js
...ents/filtered_search_bar/filtered_search_bar_root_spec.js
+22
-0
spec/frontend/vue_shared/components/filtered_search_bar/tokens/author_token_spec.js
...omponents/filtered_search_bar/tokens/author_token_spec.js
+2
-0
spec/frontend/vue_shared/components/filtered_search_bar/tokens/branch_token_spec.js
...omponents/filtered_search_bar/tokens/branch_token_spec.js
+2
-0
spec/frontend/vue_shared/components/filtered_search_bar/tokens/emoji_token_spec.js
...components/filtered_search_bar/tokens/emoji_token_spec.js
+2
-0
spec/frontend/vue_shared/components/filtered_search_bar/tokens/label_token_spec.js
...components/filtered_search_bar/tokens/label_token_spec.js
+2
-0
spec/frontend/vue_shared/components/filtered_search_bar/tokens/milestone_token_spec.js
...onents/filtered_search_bar/tokens/milestone_token_spec.js
+2
-0
spec/frontend/vue_shared/components/paginated_table_with_search_and_tabs/paginated_table_with_search_and_tabs_spec.js
...rch_and_tabs/paginated_table_with_search_and_tabs_spec.js
+4
-0
spec/frontend/vue_shared/components/sidebar/issuable_move_dropdown_spec.js
..._shared/components/sidebar/issuable_move_dropdown_spec.js
+24
-0
spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view_spec.js
...r/labels_select_vue/dropdown_contents_create_view_spec.js
+8
-0
spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_labels_view_spec.js
...r/labels_select_vue/dropdown_contents_labels_view_spec.js
+24
-0
spec/frontend/vue_shared/directives/track_event_spec.js
spec/frontend/vue_shared/directives/track_event_spec.js
+2
-0
spec/frontend/vue_shared/issuable/list/components/issuable_list_root_spec.js
...hared/issuable/list/components/issuable_list_root_spec.js
+6
-0
spec/frontend/vue_shared/issuable/show/components/issuable_title_spec.js
...ue_shared/issuable/show/components/issuable_title_spec.js
+2
-0
No files found.
.eslintrc.yml
View file @
6a0d815d
...
...
@@ -99,6 +99,10 @@ overrides:
rules
:
'
@gitlab/require-i18n-strings'
:
off
'
@gitlab/no-runtime-template-compiler'
:
off
'
no-restricted-syntax'
:
-
error
-
selector
:
CallExpression[callee.object.name=/(wrapper|vm)/][callee.property.name="setData"]
message
:
'
Avoid
using
"setData"
on
VTU
wrapper'
-
files
:
-
'
config/**/*'
-
'
scripts/**/*'
...
...
spec/frontend/alerts_settings/components/alerts_settings_form_spec.js
View file @
6a0d815d
...
...
@@ -319,6 +319,8 @@ describe('AlertsSettingsForm', () => {
const
validPayloadMsg
=
payload
===
emptySamplePayload
?
'
not valid
'
:
'
valid
'
;
it
(
`textarea should be
${
enabledState
}
when payload reset
${
payloadResetMsg
}
and payload is
${
validPayloadMsg
}
`
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentIntegration
:
{
payloadExample
:
payload
},
resetPayloadAndMappingConfirmed
,
...
...
@@ -345,6 +347,8 @@ describe('AlertsSettingsForm', () => {
:
'
was not confirmed
'
;
it
(
`shows
${
caption
}
button when sample payload
${
samplePayloadMsg
}
and payload reset
${
payloadResetMsg
}
`
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentIntegration
:
{
payloadExample
,
...
...
@@ -359,6 +363,8 @@ describe('AlertsSettingsForm', () => {
describe
(
'
Parsing payload
'
,
()
=>
{
beforeEach
(()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
resetPayloadAndMappingConfirmed
:
true
,
});
...
...
@@ -456,6 +462,8 @@ describe('AlertsSettingsForm', () => {
});
it
(
'
should be able to submit when form is dirty
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentIntegration
:
{
type
:
typeSet
.
http
,
name
:
'
Existing integration
'
},
});
...
...
@@ -466,6 +474,8 @@ describe('AlertsSettingsForm', () => {
});
it
(
'
should not be able to submit when form is pristine
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentIntegration
:
{
type
:
typeSet
.
http
,
name
:
'
Existing integration
'
},
});
...
...
spec/frontend/analytics/shared/components/projects_dropdown_filter_spec.js
View file @
6a0d815d
...
...
@@ -126,6 +126,8 @@ describe('ProjectsDropdownFilter component', () => {
});
it
(
'
applies the correct queryParams when making an api call
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
searchTerm
:
'
gitlab
'
});
expect
(
spyQuery
).
toHaveBeenCalledTimes
(
1
);
...
...
@@ -204,6 +206,8 @@ describe('ProjectsDropdownFilter component', () => {
await
createWithMockDropdown
({
multiSelect
:
true
});
selectDropdownItemAtIndex
(
0
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
searchTerm
:
'
this is a very long search string
'
});
});
...
...
spec/frontend/blob/components/blob_edit_header_spec.js
View file @
6a0d815d
...
...
@@ -44,6 +44,8 @@ describe('Blob Header Editing', () => {
const
inputComponent
=
wrapper
.
find
(
GlFormInput
);
const
newValue
=
'
bar.txt
'
;
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
name
:
newValue
,
});
...
...
spec/frontend/boards/components/boards_selector_spec.js
View file @
6a0d815d
...
...
@@ -96,6 +96,8 @@ describe('BoardsSelector', () => {
});
wrapper
.
vm
.
$apollo
.
addSmartQuery
=
jest
.
fn
((
_
,
options
)
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
[
options
.
loadingKey
]:
true
,
});
...
...
@@ -161,6 +163,8 @@ describe('BoardsSelector', () => {
// Emits gl-dropdown show event to simulate the dropdown is opened at initialization time
findDropdown
().
vm
.
$emit
(
'
show
'
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await
wrapper
.
setData
({
loadingBoards
:
false
,
loadingRecentBoards
:
false
,
...
...
@@ -176,6 +180,8 @@ describe('BoardsSelector', () => {
describe
(
'
filtering
'
,
()
=>
{
beforeEach
(
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
boards
,
});
...
...
@@ -208,6 +214,8 @@ describe('BoardsSelector', () => {
describe
(
'
recent boards section
'
,
()
=>
{
it
(
'
shows only when boards are greater than 10
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
boards
,
});
...
...
@@ -217,6 +225,8 @@ describe('BoardsSelector', () => {
});
it
(
'
does not show when boards are less than 10
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
boards
:
boards
.
slice
(
0
,
5
),
});
...
...
@@ -226,6 +236,8 @@ describe('BoardsSelector', () => {
});
it
(
'
does not show when recentBoards api returns empty array
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
recentBoards
:
[],
});
...
...
spec/frontend/ci_lint/components/ci_lint_spec.js
View file @
6a0d815d
...
...
@@ -66,6 +66,8 @@ describe('CI Lint', () => {
it
(
'
validate action calls mutation with dry run
'
,
async
()
=>
{
const
dryRunEnabled
=
true
;
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await
wrapper
.
setData
({
dryRun
:
dryRunEnabled
});
findValidateBtn
().
vm
.
$emit
(
'
click
'
);
...
...
spec/frontend/clusters/forms/components/integration_form_spec.js
View file @
6a0d815d
...
...
@@ -82,6 +82,8 @@ describe('ClusterIntegrationForm', () => {
.
then
(()
=>
{
// setData is a bad approach because it changes the internal implementation which we should not touch
// but our GlFormInput lacks the ability to set a new value.
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
toggleEnabled
:
!
defaultStoreValues
.
enabled
});
})
.
then
(()
=>
{
...
...
@@ -93,6 +95,8 @@ describe('ClusterIntegrationForm', () => {
return
wrapper
.
vm
.
$nextTick
()
.
then
(()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
envScope
:
`
${
defaultStoreValues
.
environmentScope
}
1`
});
})
.
then
(()
=>
{
...
...
spec/frontend/clusters_list/components/clusters_spec.js
View file @
6a0d815d
...
...
@@ -272,6 +272,8 @@ describe('Clusters', () => {
describe
(
'
when updating currentPage
'
,
()
=>
{
beforeEach
(()
=>
{
mockPollingApi
(
200
,
apiData
,
paginationHeader
(
totalSecondPage
,
perPage
,
2
));
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentPage
:
2
});
return
axios
.
waitForAll
();
});
...
...
spec/frontend/commit/pipelines/pipelines_table_spec.js
View file @
6a0d815d
...
...
@@ -92,6 +92,8 @@ describe('Pipelines table in Commits and Merge requests', () => {
it
(
'
should make an API request when using pagination
'
,
async
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
updateContent
'
).
mockImplementation
(()
=>
{});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await
wrapper
.
setData
({
store
:
{
state
:
{
...
...
spec/frontend/create_cluster/components/cluster_form_dropdown_spec.js
View file @
6a0d815d
...
...
@@ -206,6 +206,8 @@ describe('ClusterFormDropdown', () => {
const
searchQuery
=
secondItem
.
name
;
wrapper
.
setProps
({
items
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
searchQuery
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
...
...
spec/frontend/create_cluster/eks_cluster/components/service_credentials_form_spec.js
View file @
6a0d815d
...
...
@@ -67,6 +67,8 @@ describe('ServiceCredentialsForm', () => {
});
it
(
'
enables submit button when role ARN is not provided
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm
.
setData
({
roleArn
:
'
123
'
});
return
vm
.
vm
.
$nextTick
().
then
(()
=>
{
...
...
@@ -75,6 +77,8 @@ describe('ServiceCredentialsForm', () => {
});
it
(
'
dispatches createRole action when submit button is clicked
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm
.
setData
({
roleArn
:
'
123
'
});
// set role ARN to enable button
findSubmitButton
().
vm
.
$emit
(
'
click
'
,
new
Event
(
'
click
'
));
...
...
@@ -84,6 +88,8 @@ describe('ServiceCredentialsForm', () => {
describe
(
'
when is creating role
'
,
()
=>
{
beforeEach
(()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm
.
setData
({
roleArn
:
'
123
'
});
// set role ARN to enable button
state
.
isCreatingRole
=
true
;
...
...
spec/frontend/create_cluster/gke_cluster/components/gke_machine_type_dropdown_spec.js
View file @
6a0d815d
...
...
@@ -79,6 +79,8 @@ describe('GkeMachineTypeDropdown', () => {
store
=
createStore
();
wrapper
=
createComponent
(
store
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isLoading
:
true
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
...
...
spec/frontend/create_cluster/gke_cluster/components/gke_project_id_dropdown_spec.js
View file @
6a0d815d
...
...
@@ -83,6 +83,8 @@ describe('GkeProjectIdDropdown', () => {
it
(
'
returns default toggle text
'
,
()
=>
{
bootstrap
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isLoading
:
false
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
...
...
@@ -99,6 +101,8 @@ describe('GkeProjectIdDropdown', () => {
hasProject
:
()
=>
true
,
},
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isLoading
:
false
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
...
...
@@ -110,6 +114,8 @@ describe('GkeProjectIdDropdown', () => {
bootstrap
({
projects
:
null
,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isLoading
:
false
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
...
...
spec/frontend/create_cluster/gke_cluster/components/gke_zone_dropdown_spec.js
View file @
6a0d815d
...
...
@@ -47,6 +47,8 @@ describe('GkeZoneDropdown', () => {
describe
(
'
isLoading
'
,
()
=>
{
beforeEach
(()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isLoading
:
true
});
return
wrapper
.
vm
.
$nextTick
();
});
...
...
spec/frontend/cycle_analytics/value_stream_metrics_spec.js
View file @
6a0d815d
...
...
@@ -63,6 +63,8 @@ describe('ValueStreamMetrics', () => {
it
(
'
renders hidden GlSingleStat components for each metric
'
,
async
()
=>
{
await
waitForPromises
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isLoading
:
true
});
await
wrapper
.
vm
.
$nextTick
();
...
...
spec/frontend/deploy_freeze/components/timezone_dropdown_spec.js
View file @
6a0d815d
...
...
@@ -26,6 +26,8 @@ describe('Deploy freeze timezone dropdown', () => {
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
searchTerm
});
};
...
...
spec/frontend/design_management/components/design_overlay_spec.js
View file @
6a0d815d
...
...
@@ -117,6 +117,8 @@ describe('Design overlay component', () => {
it
.
each
([
notes
[
0
].
discussion
.
notes
.
nodes
[
1
],
notes
[
0
].
discussion
.
notes
.
nodes
[
0
]])(
'
should not apply inactive class to the pin for the active discussion
'
,
(
note
)
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
activeDiscussion
:
{
id
:
note
.
id
,
...
...
@@ -131,6 +133,8 @@ describe('Design overlay component', () => {
);
it
(
'
should apply inactive class to all pins besides the active one
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
activeDiscussion
:
{
id
:
notes
[
0
].
id
,
...
...
@@ -212,6 +216,8 @@ describe('Design overlay component', () => {
const
{
position
}
=
note
;
const
newCoordinates
=
{
x
:
20
,
y
:
20
};
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
movingNoteNewPosition
:
{
...
position
,
...
...
@@ -345,6 +351,8 @@ describe('Design overlay component', () => {
});
const
newCoordinates
=
{
x
:
20
,
y
:
20
};
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
movingNoteStartPosition
:
{
...
notes
[
0
].
position
,
...
...
@@ -368,6 +376,8 @@ describe('Design overlay component', () => {
it
(
'
should calculate delta correctly from state
'
,
()
=>
{
createComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
movingNoteStartPosition
:
{
clientX
:
10
,
...
...
spec/frontend/design_management/components/design_presentation_spec.js
View file @
6a0d815d
...
...
@@ -39,6 +39,8 @@ describe('Design management design presentation component', () => {
stubs
,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
(
data
);
wrapper
.
element
.
scrollTo
=
jest
.
fn
();
}
...
...
spec/frontend/design_management/components/image_spec.js
View file @
6a0d815d
...
...
@@ -9,6 +9,8 @@ describe('Design management large image component', () => {
wrapper
=
shallowMount
(
DesignImage
,
{
propsData
,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
(
data
);
}
...
...
spec/frontend/design_management/components/toolbar/design_navigation_spec.js
View file @
6a0d815d
...
...
@@ -42,6 +42,8 @@ describe('Design management pagination component', () => {
});
it
(
'
renders navigation buttons
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
designCollection
:
{
designs
:
[{
id
:
'
1
'
},
{
id
:
'
2
'
}]
},
});
...
...
@@ -53,6 +55,8 @@ describe('Design management pagination component', () => {
describe
(
'
keyboard buttons navigation
'
,
()
=>
{
beforeEach
(()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
designCollection
:
{
designs
:
[{
filename
:
'
1
'
},
{
filename
:
'
2
'
},
{
filename
:
'
3
'
}]
},
});
...
...
spec/frontend/design_management/components/toolbar/index_spec.js
View file @
6a0d815d
...
...
@@ -48,6 +48,8 @@ describe('Design management toolbar component', () => {
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
permissions
:
{
createDesign
,
...
...
spec/frontend/design_management/components/upload/design_version_dropdown_spec.js
View file @
6a0d815d
...
...
@@ -34,6 +34,8 @@ describe('Design management design version dropdown component', () => {
stubs
:
{
GlSprintf
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
allVersions
:
maxVersions
>
-
1
?
mockAllVersions
.
slice
(
0
,
maxVersions
)
:
mockAllVersions
,
});
...
...
spec/frontend/design_management/pages/design/index_spec.js
View file @
6a0d815d
...
...
@@ -317,6 +317,8 @@ describe('Design management design index page', () => {
describe
(
'
when no design exists for given version
'
,
()
=>
{
it
(
'
redirects to /designs
'
,
()
=>
{
createComponent
({
loading
:
true
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
allVersions
:
mockAllVersions
,
});
...
...
spec/frontend/design_management/pages/index_spec.js
View file @
6a0d815d
...
...
@@ -204,6 +204,8 @@ describe('Design management index page', () => {
it
(
'
renders error
'
,
async
()
=>
{
createComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
error
:
true
});
await
nextTick
();
...
...
@@ -381,6 +383,8 @@ describe('Design management index page', () => {
it
(
'
updates state appropriately after upload complete
'
,
async
()
=>
{
createComponent
({
stubs
:
{
GlEmptyState
}
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
filesToBeSaved
:
[{
name
:
'
test
'
}]
});
wrapper
.
vm
.
onUploadDesignDone
(
designUploadMutationCreatedResponse
);
...
...
@@ -393,6 +397,8 @@ describe('Design management index page', () => {
it
(
'
updates state appropriately after upload error
'
,
async
()
=>
{
createComponent
({
stubs
:
{
GlEmptyState
}
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
filesToBeSaved
:
[{
name
:
'
test
'
}]
});
wrapper
.
vm
.
onUploadDesignError
();
...
...
spec/frontend/emoji/components/category_spec.js
View file @
6a0d815d
...
...
@@ -26,6 +26,8 @@ describe('Emoji category component', () => {
});
it
(
'
renders group
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await
wrapper
.
setData
({
renderGroup
:
true
});
expect
(
wrapper
.
find
(
EmojiGroup
).
attributes
(
'
rendergroup
'
)).
toBe
(
'
true
'
);
...
...
spec/frontend/emoji/components/emoji_list_spec.js
View file @
6a0d815d
...
...
@@ -28,6 +28,8 @@ async function factory(render, propsData = { searchValue: '' }) {
await
nextTick
();
if
(
render
)
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
render
:
true
});
// Wait for component to render
...
...
spec/frontend/error_tracking/components/error_details_spec.js
View file @
6a0d815d
...
...
@@ -173,6 +173,8 @@ describe('ErrorDetails', () => {
beforeEach
(()
=>
{
mocks
.
$apollo
.
queries
.
error
.
loading
=
false
;
mountComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
error
:
{
id
:
'
gid://gitlab/Gitlab::ErrorTracking::DetailedError/129381
'
,
...
...
@@ -203,6 +205,8 @@ describe('ErrorDetails', () => {
const
culprit
=
'
<script>console.log("surprise!")</script>
'
;
beforeEach
(()
=>
{
store
.
state
.
details
.
loadingStacktrace
=
false
;
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
error
:
{
culprit
,
...
...
@@ -222,6 +226,8 @@ describe('ErrorDetails', () => {
describe
(
'
Badges
'
,
()
=>
{
it
(
'
should show language and error level badges
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
error
:
{
tags
:
{
level
:
'
error
'
,
logger
:
'
ruby
'
},
...
...
@@ -233,6 +239,8 @@ describe('ErrorDetails', () => {
});
it
(
'
should NOT show the badge if the tag is not present
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
error
:
{
tags
:
{
level
:
'
error
'
},
...
...
@@ -246,6 +254,8 @@ describe('ErrorDetails', () => {
it
.
each
(
Object
.
keys
(
severityLevel
))(
'
should set correct severity level variant for %s badge
'
,
(
level
)
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
error
:
{
tags
:
{
level
:
severityLevel
[
level
]
},
...
...
@@ -260,6 +270,8 @@ describe('ErrorDetails', () => {
);
it
(
'
should fallback for ERROR severityLevelVariant when severityLevel is unknown
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
error
:
{
tags
:
{
level
:
'
someNewErrorLevel
'
},
...
...
@@ -408,6 +420,8 @@ describe('ErrorDetails', () => {
it
(
'
should show alert with closed issueId
'
,
()
=>
{
const
closedIssueId
=
123
;
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isAlertVisible
:
true
,
closedIssueId
,
...
...
@@ -429,6 +443,8 @@ describe('ErrorDetails', () => {
describe
(
'
is present
'
,
()
=>
{
beforeEach
(()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
error
:
{
gitlabIssuePath
,
...
...
@@ -451,6 +467,8 @@ describe('ErrorDetails', () => {
describe
(
'
is not present
'
,
()
=>
{
beforeEach
(()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
error
:
{
gitlabIssuePath
:
null
,
...
...
@@ -480,6 +498,8 @@ describe('ErrorDetails', () => {
it
(
'
should display a link
'
,
()
=>
{
mocks
.
$apollo
.
queries
.
error
.
loading
=
false
;
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
error
:
{
gitlabCommit
,
...
...
@@ -493,6 +513,8 @@ describe('ErrorDetails', () => {
it
(
'
should not display a link
'
,
()
=>
{
mocks
.
$apollo
.
queries
.
error
.
loading
=
false
;
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
error
:
{
gitlabCommit
:
null
,
...
...
@@ -519,6 +541,8 @@ describe('ErrorDetails', () => {
it
(
'
should display links to Sentry
'
,
async
()
=>
{
mocks
.
$apollo
.
queries
.
error
.
loading
=
false
;
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await
wrapper
.
setData
({
error
:
{
firstReleaseVersion
,
...
...
@@ -535,6 +559,8 @@ describe('ErrorDetails', () => {
it
(
'
should display links to GitLab when integrated
'
,
async
()
=>
{
mocks
.
$apollo
.
queries
.
error
.
loading
=
false
;
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await
wrapper
.
setData
({
error
:
{
firstReleaseVersion
,
...
...
@@ -557,6 +583,8 @@ describe('ErrorDetails', () => {
jest
.
spyOn
(
Tracking
,
'
event
'
);
mocks
.
$apollo
.
queries
.
error
.
loading
=
false
;
mountComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
error
:
{
externalUrl
},
});
...
...
spec/frontend/error_tracking/components/error_tracking_list_spec.js
View file @
6a0d815d
...
...
@@ -396,6 +396,8 @@ describe('ErrorTrackingList', () => {
GlPagination
:
false
,
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
pageValue
:
2
});
return
wrapper
.
vm
.
$nextTick
();
});
...
...
spec/frontend/ide/components/preview/clientside_spec.js
View file @
6a0d815d
...
...
@@ -73,6 +73,8 @@ describe('IDE clientside preview', () => {
const
createInitializedComponent
=
()
=>
{
createComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
sandpackReady
:
true
,
manager
:
{
...
...
@@ -202,6 +204,8 @@ describe('IDE clientside preview', () => {
it
(
'
returns false if loading and mainEntry exists
'
,
()
=>
{
createComponent
({
getters
:
{
packageJson
:
dummyPackageJson
}
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
loading
:
true
});
expect
(
wrapper
.
vm
.
showPreview
).
toBe
(
false
);
...
...
@@ -209,6 +213,8 @@ describe('IDE clientside preview', () => {
it
(
'
returns true if not loading and mainEntry exists
'
,
()
=>
{
createComponent
({
getters
:
{
packageJson
:
dummyPackageJson
}
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
loading
:
false
});
expect
(
wrapper
.
vm
.
showPreview
).
toBe
(
true
);
...
...
@@ -218,12 +224,16 @@ describe('IDE clientside preview', () => {
describe
(
'
showEmptyState
'
,
()
=>
{
it
(
'
returns true if no mainEntry exists
'
,
()
=>
{
createComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
loading
:
false
});
expect
(
wrapper
.
vm
.
showEmptyState
).
toBe
(
true
);
});
it
(
'
returns false if loading
'
,
()
=>
{
createComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
loading
:
true
});
expect
(
wrapper
.
vm
.
showEmptyState
).
toBe
(
false
);
...
...
@@ -231,6 +241,8 @@ describe('IDE clientside preview', () => {
it
(
'
returns false if not loading and mainEntry exists
'
,
()
=>
{
createComponent
({
getters
:
{
packageJson
:
dummyPackageJson
}
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
loading
:
false
});
expect
(
wrapper
.
vm
.
showEmptyState
).
toBe
(
false
);
...
...
@@ -307,6 +319,8 @@ describe('IDE clientside preview', () => {
describe
(
'
update
'
,
()
=>
{
it
(
'
initializes manager if manager is empty
'
,
()
=>
{
createComponent
({
getters
:
{
packageJson
:
dummyPackageJson
}
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
sandpackReady
:
true
});
wrapper
.
vm
.
update
();
...
...
@@ -340,6 +354,8 @@ describe('IDE clientside preview', () => {
describe
(
'
template
'
,
()
=>
{
it
(
'
renders ide-preview element when showPreview is true
'
,
()
=>
{
createComponent
({
getters
:
{
packageJson
:
dummyPackageJson
}
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
loading
:
false
});
return
wrapper
.
vm
.
$nextTick
(()
=>
{
...
...
@@ -349,6 +365,8 @@ describe('IDE clientside preview', () => {
it
(
'
renders empty state
'
,
()
=>
{
createComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
loading
:
false
});
return
wrapper
.
vm
.
$nextTick
(()
=>
{
...
...
@@ -360,6 +378,8 @@ describe('IDE clientside preview', () => {
it
(
'
renders loading icon
'
,
()
=>
{
createComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
loading
:
true
});
return
wrapper
.
vm
.
$nextTick
(()
=>
{
...
...
spec/frontend/ide/components/terminal/terminal_spec.js
View file @
6a0d815d
...
...
@@ -128,6 +128,8 @@ describe('IDE Terminal', () => {
canScrollDown
:
false
,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
canScrollUp
:
true
,
canScrollDown
:
true
});
return
nextTick
().
then
(()
=>
{
...
...
spec/frontend/invite_members/components/invite_members_modal_spec.js
View file @
6a0d815d
...
...
@@ -474,6 +474,8 @@ describe('InviteMembersModal', () => {
beforeEach
(()
=>
{
createInviteMembersToGroupWrapper
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
newUsersToInvite
:
[
user1
]
});
});
...
...
@@ -644,6 +646,8 @@ describe('InviteMembersModal', () => {
beforeEach
(()
=>
{
createInviteMembersToGroupWrapper
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
newUsersToInvite
:
[
user3
]
});
});
...
...
@@ -712,6 +716,8 @@ describe('InviteMembersModal', () => {
it
(
'
displays the invalid syntax error if one of the emails is invalid
'
,
async
()
=>
{
createInviteMembersToGroupWrapper
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
newUsersToInvite
:
[
user3
,
user4
]
});
mockInvitationsApi
(
httpStatus
.
CREATED
,
invitationsApiResponse
.
ERROR_EMAIL_INVALID
);
...
...
@@ -787,6 +793,8 @@ describe('InviteMembersModal', () => {
beforeEach
(()
=>
{
createInviteMembersToGroupWrapper
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
newUsersToInvite
:
[
user1
,
user3
]
});
mockInvitationsApi
(
httpStatus
.
BAD_REQUEST
,
invitationsApiResponse
.
EMAIL_INVALID
);
...
...
@@ -815,6 +823,8 @@ describe('InviteMembersModal', () => {
beforeEach
(()
=>
{
createComponent
({
groupToBeSharedWith
:
sharedGroup
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
inviteeType
:
'
group
'
});
wrapper
.
vm
.
$toast
=
{
show
:
jest
.
fn
()
};
jest
.
spyOn
(
Api
,
'
groupShareWithGroup
'
).
mockResolvedValue
({
data
:
groupPostData
});
...
...
@@ -837,6 +847,8 @@ describe('InviteMembersModal', () => {
beforeEach
(()
=>
{
createInviteGroupToGroupWrapper
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
groupToBeSharedWith
:
sharedGroup
});
wrapper
.
vm
.
$toast
=
{
show
:
jest
.
fn
()
};
...
...
spec/frontend/issuable/components/related_issuable_item_spec.js
View file @
6a0d815d
...
...
@@ -169,6 +169,8 @@ describe('RelatedIssuableItem', () => {
});
it
(
'
renders disabled button when removeDisabled
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
removeDisabled
:
true
});
await
wrapper
.
vm
.
$nextTick
();
...
...
spec/frontend/issues/new/components/title_suggestions_spec.js
View file @
6a0d815d
...
...
@@ -38,6 +38,8 @@ describe('Issue title suggestions component', () => {
});
it
(
'
renders component
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
(
data
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
...
...
@@ -47,6 +49,8 @@ describe('Issue title suggestions component', () => {
it
(
'
does not render with empty search
'
,
()
=>
{
wrapper
.
setProps
({
search
:
''
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
(
data
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
...
...
@@ -55,6 +59,8 @@ describe('Issue title suggestions component', () => {
});
it
(
'
does not render when loading
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
...
data
,
loading
:
1
,
...
...
@@ -66,6 +72,8 @@ describe('Issue title suggestions component', () => {
});
it
(
'
does not render with empty issues data
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
issues
:
[]
});
return
wrapper
.
vm
.
$nextTick
(()
=>
{
...
...
@@ -74,6 +82,8 @@ describe('Issue title suggestions component', () => {
});
it
(
'
renders list of issues
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
(
data
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
...
...
@@ -82,6 +92,8 @@ describe('Issue title suggestions component', () => {
});
it
(
'
adds margin class to first item
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
(
data
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
...
...
@@ -90,6 +102,8 @@ describe('Issue title suggestions component', () => {
});
it
(
'
does not add margin class to last item
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
(
data
);
return
wrapper
.
vm
.
$nextTick
(()
=>
{
...
...
spec/frontend/jobs/components/table/job_table_app_spec.js
View file @
6a0d815d
...
...
@@ -114,6 +114,8 @@ describe('Job table app', () => {
await
wrapper
.
vm
.
$nextTick
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
jobs
:
{
pageInfo
:
{
...
...
spec/frontend/monitoring/components/charts/time_series_spec.js
View file @
6a0d815d
...
...
@@ -661,6 +661,8 @@ describe('Time series component', () => {
const
commitUrl
=
`
${
mockProjectDir
}
/-/commit/
${
mockSha
}
`
;
beforeEach
(()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
tooltip
:
{
type
:
'
deployments
'
,
...
...
spec/frontend/monitoring/components/dashboard_spec.js
View file @
6a0d815d
...
...
@@ -792,6 +792,8 @@ describe('Dashboard', () => {
});
createShallowWrapper
({
hasMetrics
:
true
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
hoveredPanel
:
panelRef
});
return
wrapper
.
vm
.
$nextTick
();
...
...
spec/frontend/monitoring/components/dashboards_dropdown_spec.js
View file @
6a0d815d
...
...
@@ -38,6 +38,8 @@ describe('DashboardsDropdown', () => {
const
findSearchInput
=
()
=>
wrapper
.
find
({
ref
:
'
monitorDashboardsDropdownSearch
'
});
const
findNoItemsMsg
=
()
=>
wrapper
.
find
({
ref
:
'
monitorDashboardsDropdownMsg
'
});
const
findStarredListDivider
=
()
=>
wrapper
.
find
({
ref
:
'
starredListDivider
'
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
const
setSearchTerm
=
(
searchTerm
)
=>
wrapper
.
setData
({
searchTerm
});
beforeEach
(()
=>
{
...
...
spec/frontend/mr_popover/mr_popover_spec.js
View file @
6a0d815d
...
...
@@ -35,6 +35,8 @@ describe('MR Popover', () => {
describe
(
'
loaded state
'
,
()
=>
{
it
(
'
matches the snapshot
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
mergeRequest
:
{
title
:
'
Updated Title
'
,
...
...
@@ -55,6 +57,8 @@ describe('MR Popover', () => {
});
it
(
'
does not show CI Icon if there is no pipeline data
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
mergeRequest
:
{
state
:
'
opened
'
,
...
...
spec/frontend/notes/components/comment_form_spec.js
View file @
6a0d815d
...
...
@@ -263,6 +263,8 @@ describe('issue_comment_form component', () => {
jest
.
spyOn
(
wrapper
.
vm
,
'
stopPolling
'
);
jest
.
spyOn
(
wrapper
.
vm
,
'
saveNote
'
).
mockResolvedValue
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await
wrapper
.
setData
({
note
:
'
hello world
'
});
await
findCommentButton
().
trigger
(
'
click
'
);
...
...
@@ -388,6 +390,8 @@ describe('issue_comment_form component', () => {
it
(
'
should enable comment button if it has note
'
,
async
()
=>
{
mountComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await
wrapper
.
setData
({
note
:
'
Foo
'
});
expect
(
findCommentTypeDropdown
().
props
(
'
disabled
'
)).
toBe
(
false
);
...
...
spec/frontend/notes/components/note_form_spec.js
View file @
6a0d815d
...
...
@@ -257,6 +257,8 @@ describe('issue_note_form component', () => {
props
=
{
...
props
,
...
options
};
wrapper
=
createComponentWrapper
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isSubmittingWithKeydown
:
true
});
const
textarea
=
wrapper
.
find
(
'
textarea
'
);
...
...
spec/frontend/notifications/components/custom_notifications_modal_spec.js
View file @
6a0d815d
...
...
@@ -88,6 +88,8 @@ describe('CustomNotificationsModal', () => {
beforeEach
(
async
()
=>
{
wrapper
=
createComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
events
:
[
{
id
:
'
new_release
'
,
enabled
:
true
,
name
:
'
New release
'
,
loading
:
false
},
...
...
@@ -211,6 +213,8 @@ describe('CustomNotificationsModal', () => {
wrapper
=
createComponent
({
injectedProperties
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
events
:
[
{
id
:
'
new_release
'
,
enabled
:
true
,
name
:
'
New release
'
,
loading
:
false
},
...
...
@@ -239,6 +243,8 @@ describe('CustomNotificationsModal', () => {
mockAxios
.
onPut
(
'
/api/v4/notification_settings
'
).
reply
(
httpStatus
.
NOT_FOUND
,
{});
wrapper
=
createComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
events
:
[
{
id
:
'
new_release
'
,
enabled
:
true
,
name
:
'
New release
'
,
loading
:
false
},
...
...
spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/packages_list_spec.js
View file @
6a0d815d
...
...
@@ -134,6 +134,8 @@ describe('packages_list', () => {
});
it
(
'
deleteItemConfirmation resets itemToBeDeleted
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
itemToBeDeleted
:
1
});
wrapper
.
vm
.
deleteItemConfirmation
();
expect
(
wrapper
.
vm
.
itemToBeDeleted
).
toEqual
(
null
);
...
...
@@ -141,6 +143,8 @@ describe('packages_list', () => {
it
(
'
deleteItemConfirmation emit package:delete
'
,
()
=>
{
const
itemToBeDeleted
=
{
id
:
2
};
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
itemToBeDeleted
});
wrapper
.
vm
.
deleteItemConfirmation
();
return
wrapper
.
vm
.
$nextTick
(()
=>
{
...
...
@@ -149,6 +153,8 @@ describe('packages_list', () => {
});
it
(
'
deleteItemCanceled resets itemToBeDeleted
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
itemToBeDeleted
:
1
});
wrapper
.
vm
.
deleteItemCanceled
();
expect
(
wrapper
.
vm
.
itemToBeDeleted
).
toEqual
(
null
);
...
...
@@ -194,6 +200,8 @@ describe('packages_list', () => {
beforeEach
(()
=>
{
mountComponent
();
eventSpy
=
jest
.
spyOn
(
Tracking
,
'
event
'
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
itemToBeDeleted
:
{
package_type
:
'
conan
'
}
});
});
...
...
spec/frontend/profile/account/components/update_username_spec.js
View file @
6a0d815d
...
...
@@ -79,6 +79,8 @@ describe('UpdateUsername component', () => {
beforeEach
(
async
()
=>
{
createComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
newUsername
});
await
wrapper
.
vm
.
$nextTick
();
...
...
spec/frontend/projects/commits/components/author_select_spec.js
View file @
6a0d815d
...
...
@@ -65,6 +65,8 @@ describe('Author Select', () => {
describe
(
'
user is searching via "filter by commit message"
'
,
()
=>
{
it
(
'
disables dropdown container
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
hasSearchParam
:
true
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
...
...
@@ -73,6 +75,8 @@ describe('Author Select', () => {
});
it
(
'
has correct tooltip message
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
hasSearchParam
:
true
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
...
...
@@ -83,6 +87,8 @@ describe('Author Select', () => {
});
it
(
'
disables dropdown
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
hasSearchParam
:
false
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
...
...
@@ -103,6 +109,8 @@ describe('Author Select', () => {
});
it
(
'
displays the current selected author
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentAuthor
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
...
...
@@ -156,6 +164,8 @@ describe('Author Select', () => {
isChecked
:
true
,
};
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentAuthor
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
...
...
spec/frontend/projects/compare/components/revision_dropdown_legacy_spec.js
View file @
6a0d815d
...
...
@@ -101,6 +101,8 @@ describe('RevisionDropdown component', () => {
const
findGlDropdownItems
=
()
=>
wrapper
.
findAll
(
GlDropdownItem
);
const
findFirstGlDropdownItem
=
()
=>
findGlDropdownItems
().
at
(
0
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
branches
:
[
'
some-branch
'
]
});
await
wrapper
.
vm
.
$nextTick
();
...
...
spec/frontend/repository/components/blob_content_viewer_spec.js
View file @
6a0d815d
...
...
@@ -83,6 +83,8 @@ const createComponent = async (mockData = {}, mountFn = shallowMount) => {
}),
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
project
,
isBinary
});
await
waitForPromises
();
...
...
spec/frontend/repository/components/breadcrumbs_spec.js
View file @
6a0d815d
...
...
@@ -75,6 +75,8 @@ describe('Repository breadcrumbs component', () => {
it
(
'
does not render add to tree dropdown when permissions are false
'
,
async
()
=>
{
factory
(
'
/
'
,
{
canCollaborate
:
false
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
userPermissions
:
{
forkProject
:
false
,
createMergeRequestIn
:
false
}
});
await
wrapper
.
vm
.
$nextTick
();
...
...
@@ -100,6 +102,8 @@ describe('Repository breadcrumbs component', () => {
it
(
'
renders add to tree dropdown when permissions are true
'
,
async
()
=>
{
factory
(
'
/
'
,
{
canCollaborate
:
true
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
userPermissions
:
{
forkProject
:
true
,
createMergeRequestIn
:
true
}
});
await
wrapper
.
vm
.
$nextTick
();
...
...
@@ -117,6 +121,8 @@ describe('Repository breadcrumbs component', () => {
});
it
(
'
renders the modal once loaded
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
$apollo
:
{
queries
:
{
userPermissions
:
{
loading
:
false
}
}
}
});
await
wrapper
.
vm
.
$nextTick
();
...
...
@@ -139,6 +145,8 @@ describe('Repository breadcrumbs component', () => {
});
it
(
'
renders the modal once loaded
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
$apollo
:
{
queries
:
{
userPermissions
:
{
loading
:
false
}
}
}
});
await
wrapper
.
vm
.
$nextTick
();
...
...
spec/frontend/repository/components/last_commit_spec.js
View file @
6a0d815d
...
...
@@ -43,6 +43,8 @@ function factory(commit = createCommitData(), loading = false) {
},
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm
.
setData
({
commit
});
vm
.
vm
.
$apollo
.
queries
.
commit
.
loading
=
loading
;
}
...
...
spec/frontend/repository/components/preview/index_spec.js
View file @
6a0d815d
...
...
@@ -34,6 +34,8 @@ describe('Repository file preview component', () => {
name
:
'
README.md
'
,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm
.
setData
({
readme
:
{
html
:
'
<div class="blob">test</div>
'
}
});
return
vm
.
vm
.
$nextTick
(()
=>
{
...
...
@@ -47,6 +49,8 @@ describe('Repository file preview component', () => {
name
:
'
README.md
'
,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm
.
setData
({
readme
:
{
html
:
'
<div class="blob">test</div>
'
}
});
return
vm
.
vm
...
...
@@ -63,6 +67,8 @@ describe('Repository file preview component', () => {
name
:
'
README.md
'
,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm
.
setData
({
loading
:
1
});
return
vm
.
vm
.
$nextTick
(()
=>
{
...
...
spec/frontend/repository/components/table/index_spec.js
View file @
6a0d815d
...
...
@@ -89,6 +89,8 @@ describe('Repository table component', () => {
`
(
'
renders table caption for $ref in $path
'
,
({
path
,
ref
})
=>
{
factory
({
path
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm
.
setData
({
ref
});
return
vm
.
vm
.
$nextTick
(()
=>
{
...
...
spec/frontend/repository/components/table/row_spec.js
View file @
6a0d815d
...
...
@@ -40,6 +40,8 @@ function factory(propsData = {}) {
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm
.
setData
({
escapedRef
:
'
main
'
});
}
...
...
spec/frontend/repository/components/tree_content_spec.js
View file @
6a0d815d
...
...
@@ -46,6 +46,8 @@ describe('Repository table component', () => {
it
(
'
renders file preview
'
,
async
()
=>
{
factory
(
'
/
'
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm
.
setData
({
entries
:
{
blobs
:
[{
name
:
'
README.md
'
}]
}
});
await
vm
.
vm
.
$nextTick
();
...
...
@@ -134,6 +136,8 @@ describe('Repository table component', () => {
it
(
'
is not rendered if less than 1000 files
'
,
async
()
=>
{
factory
(
'
/
'
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm
.
setData
({
fetchCounter
:
5
,
clickedShowMore
:
false
});
await
vm
.
vm
.
$nextTick
();
...
...
@@ -153,6 +157,8 @@ describe('Repository table component', () => {
factory
(
'
/
'
);
const
blobs
=
new
Array
(
totalBlobs
).
fill
(
'
fakeBlob
'
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm
.
setData
({
entries
:
{
blobs
},
pagesLoaded
});
await
vm
.
vm
.
$nextTick
();
...
...
@@ -173,6 +179,8 @@ describe('Repository table component', () => {
${
200
}
|
${
100
}
`
(
'
exponentially increases page size, to a maximum of 100
'
,
({
fetchCounter
,
pageSize
})
=>
{
factory
(
'
/
'
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
vm
.
setData
({
fetchCounter
});
vm
.
vm
.
fetchFiles
();
...
...
spec/frontend/repository/components/upload_blob_modal_spec.js
View file @
6a0d815d
...
...
@@ -109,6 +109,8 @@ describe('UploadBlobModal', () => {
if
(
canPushCode
)
{
describe
(
'
when changing the branch name
'
,
()
=>
{
it
(
'
displays the MR toggle
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
target
:
'
Not main
'
});
await
wrapper
.
vm
.
$nextTick
();
...
...
@@ -120,6 +122,8 @@ describe('UploadBlobModal', () => {
describe
(
'
completed form
'
,
()
=>
{
beforeEach
(()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
file
:
{
type
:
'
jpg
'
},
filePreviewURL
:
'
http://file.com?format=jpg
'
,
...
...
spec/frontend/search/topbar/components/searchable_dropdown_spec.js
View file @
6a0d815d
...
...
@@ -133,6 +133,8 @@ describe('Global Search Searchable Dropdown', () => {
describe
(
`when search is
${
searchText
}
and frequentItems length is
${
frequentItems
.
length
}
`
,
()
=>
{
beforeEach
(()
=>
{
createComponent
({},
{
frequentItems
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
searchText
});
});
...
...
@@ -202,6 +204,8 @@ describe('Global Search Searchable Dropdown', () => {
describe
(
'
not for the first time
'
,
()
=>
{
beforeEach
(()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
hasBeenOpened
:
true
});
findGlDropdown
().
vm
.
$emit
(
'
show
'
);
});
...
...
spec/frontend/sidebar/components/reviewers/uncollapsed_reviewer_list_spec.js
View file @
6a0d815d
...
...
@@ -48,12 +48,16 @@ describe('UncollapsedReviewerList component', () => {
});
it
(
'
renders re-request loading icon
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await
wrapper
.
setData
({
loadingStates
:
{
1
:
'
loading
'
}
});
expect
(
wrapper
.
find
(
'
[data-testid="re-request-button"]
'
).
props
(
'
loading
'
)).
toBe
(
true
);
});
it
(
'
renders re-request success icon
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await
wrapper
.
setData
({
loadingStates
:
{
1
:
'
success
'
}
});
expect
(
wrapper
.
find
(
'
[data-testid="re-request-success"]
'
).
exists
()).
toBe
(
true
);
...
...
@@ -98,6 +102,8 @@ describe('UncollapsedReviewerList component', () => {
});
it
(
'
renders re-request loading icon
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await
wrapper
.
setData
({
loadingStates
:
{
2
:
'
loading
'
}
});
expect
(
wrapper
.
findAll
(
'
[data-testid="re-request-button"]
'
).
length
).
toBe
(
2
);
...
...
@@ -107,6 +113,8 @@ describe('UncollapsedReviewerList component', () => {
});
it
(
'
renders re-request success icon
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await
wrapper
.
setData
({
loadingStates
:
{
2
:
'
success
'
}
});
expect
(
wrapper
.
findAll
(
'
[data-testid="re-request-button"]
'
).
length
).
toBe
(
1
);
...
...
spec/frontend/sidebar/participants_spec.js
View file @
6a0d815d
...
...
@@ -85,6 +85,8 @@ describe('Participants', () => {
numberOfLessParticipants
,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isShowingMoreParticipants
:
false
,
});
...
...
@@ -101,6 +103,8 @@ describe('Participants', () => {
numberOfLessParticipants
:
2
,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isShowingMoreParticipants
:
true
,
});
...
...
@@ -129,6 +133,8 @@ describe('Participants', () => {
numberOfLessParticipants
:
2
,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isShowingMoreParticipants
:
false
,
});
...
...
@@ -145,6 +151,8 @@ describe('Participants', () => {
numberOfLessParticipants
:
2
,
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isShowingMoreParticipants
:
true
,
});
...
...
spec/frontend/snippets/components/snippet_blob_view_spec.js
View file @
6a0d815d
...
...
@@ -157,6 +157,8 @@ describe('Blob Embeddable', () => {
});
// mimic apollo's update
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
blobContent
:
wrapper
.
vm
.
onContentUpdate
(
apolloData
),
});
...
...
spec/frontend/snippets/components/snippet_header_spec.js
View file @
6a0d815d
...
...
@@ -242,6 +242,8 @@ describe('Snippet header component', () => {
// TODO: we should avoid `wrapper.setData` since they
// are component internals. Let's use the apollo mock helpers
// in a follow-up.
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
canCreateSnippet
:
true
});
await
wrapper
.
vm
.
$nextTick
();
...
...
spec/frontend/static_site_editor/components/edit_area_spec.js
View file @
6a0d815d
...
...
@@ -132,6 +132,8 @@ describe('~/static_site_editor/components/edit_area.vue', () => {
describe
(
'
when the mode changes
'
,
()
=>
{
const
setInitialMode
=
(
mode
)
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
editorMode
:
mode
});
};
...
...
@@ -207,6 +209,8 @@ describe('~/static_site_editor/components/edit_area.vue', () => {
});
it
(
'
syncs matter changes to content in markdown mode
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
editorMode
:
EDITOR_TYPES
.
markdown
});
const
newSettings
=
{
title
:
'
test
'
};
...
...
spec/frontend/static_site_editor/rich_content_editor/modals/add_image/add_image_modal_spec.js
View file @
6a0d815d
...
...
@@ -48,6 +48,8 @@ describe('Add Image Modal', () => {
const
file
=
{
name
:
'
some_file.png
'
};
wrapper
.
vm
.
$refs
.
uploadImageTab
=
{
validateFile
:
jest
.
fn
()
};
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
file
,
description
,
tabIndex
:
IMAGE_TABS
.
UPLOAD_TAB
});
findModal
().
vm
.
$emit
(
'
ok
'
,
{
preventDefault
});
...
...
@@ -60,6 +62,8 @@ describe('Add Image Modal', () => {
it
(
'
emits an addImage event when a valid URL is specified
'
,
()
=>
{
const
preventDefault
=
jest
.
fn
();
const
mockImage
=
{
imageUrl
:
'
/some/valid/url.png
'
,
description
:
'
some description
'
};
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
...
mockImage
,
tabIndex
:
IMAGE_TABS
.
URL_TAB
});
findModal
().
vm
.
$emit
(
'
ok
'
,
{
preventDefault
});
...
...
spec/frontend/terraform/components/states_table_actions_spec.js
View file @
6a0d815d
...
...
@@ -293,6 +293,8 @@ describe('StatesTableActions', () => {
describe
(
'
when state name is present
'
,
()
=>
{
beforeEach
(
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
await
wrapper
.
setData
({
removeConfirmText
:
defaultProps
.
state
.
name
});
findRemoveModal
().
vm
.
$emit
(
'
ok
'
);
...
...
spec/frontend/vue_mr_widget/components/approvals/approvals_spec.js
View file @
6a0d815d
...
...
@@ -101,6 +101,8 @@ describe('MRWidget approvals', () => {
});
it
(
'
shows loading message
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
fetchingApprovals
:
true
});
return
tick
().
then
(()
=>
{
...
...
spec/frontend/vue_mr_widget/components/mr_widget_rebase_spec.js
View file @
6a0d815d
...
...
@@ -88,6 +88,8 @@ describe('Merge request widget rebase component', () => {
mergeRequestWidgetGraphql
,
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
rebasingError
:
'
Something went wrong!
'
});
await
nextTick
();
...
...
spec/frontend/vue_mr_widget/components/states/mr_widget_auto_merge_enabled_spec.js
View file @
6a0d815d
...
...
@@ -253,6 +253,8 @@ describe('MRWidgetAutoMergeEnabled', () => {
factory
({
...
defaultMrProps
(),
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isCancellingAutoMerge
:
true
,
});
...
...
@@ -287,6 +289,8 @@ describe('MRWidgetAutoMergeEnabled', () => {
factory
({
...
defaultMrProps
(),
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isRemovingSourceBranch
:
true
,
});
...
...
spec/frontend/vue_mr_widget/components/states/mr_widget_commits_header_spec.js
View file @
6a0d815d
...
...
@@ -60,6 +60,8 @@ describe('Commits header component', () => {
it
(
'
has a chevron-right icon
'
,
()
=>
{
createComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
expanded
:
false
});
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
...
...
@@ -111,6 +113,8 @@ describe('Commits header component', () => {
describe
(
'
when expanded
'
,
()
=>
{
beforeEach
(()
=>
{
createComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
expanded
:
true
});
});
...
...
spec/frontend/vue_mr_widget/components/states/mr_widget_conflicts_spec.js
View file @
6a0d815d
...
...
@@ -41,6 +41,8 @@ describe('MRWidgetConflicts', () => {
);
if
(
mergeRequestWidgetGraphql
)
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
userPermissions
:
{
canMerge
:
propsData
.
mr
.
canMerge
,
...
...
spec/frontend/vue_mr_widget/components/states/mr_widget_missing_branch_spec.js
View file @
6a0d815d
...
...
@@ -14,6 +14,8 @@ function factory(sourceBranchRemoved, mergeRequestWidgetGraphql) {
});
if
(
mergeRequestWidgetGraphql
)
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
state
:
{
sourceBranchExists
:
!
sourceBranchRemoved
}
});
}
...
...
spec/frontend/vue_mr_widget/components/states/mr_widget_ready_to_merge_spec.js
View file @
6a0d815d
...
...
@@ -192,6 +192,8 @@ describe('ReadyToMerge', () => {
it
(
'
should return "Merge in progress"
'
,
async
()
=>
{
createComponent
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isMergingImmediately
:
true
});
await
Vue
.
nextTick
();
...
...
@@ -260,6 +262,8 @@ describe('ReadyToMerge', () => {
it
(
'
should return true when the vm instance is making request
'
,
async
()
=>
{
createComponent
({
mr
:
{
isMergeAllowed
:
true
}
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isMakingRequest
:
true
});
await
Vue
.
nextTick
();
...
...
@@ -287,6 +291,8 @@ describe('ReadyToMerge', () => {
jest
.
spyOn
(
wrapper
.
vm
.
service
,
'
merge
'
)
.
mockReturnValue
(
returnPromise
(
'
merge_when_pipeline_succeeds
'
));
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
removeSourceBranch
:
false
});
wrapper
.
vm
.
handleMergeButtonClick
(
true
);
...
...
@@ -691,6 +697,8 @@ describe('ReadyToMerge', () => {
true
,
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
loading
:
false
,
state
:
{
...
...
spec/frontend/vue_mr_widget/components/terraform/mr_widget_terraform_container_spec.js
View file @
6a0d815d
...
...
@@ -43,6 +43,8 @@ describe('MrWidgetTerraformConainer', () => {
mockPollingApi
(
200
,
plans
,
{});
return
mountWrapper
().
then
(()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
loading
:
true
});
return
wrapper
.
vm
.
$nextTick
();
});
...
...
spec/frontend/vue_shared/alert_details/alert_details_spec.js
View file @
6a0d815d
...
...
@@ -349,6 +349,8 @@ describe('AlertDetails', () => {
${
1
}
|
${
'
metrics
'
}
${
2
}
|
${
'
activity
'
}
`
(
'
will navigate to the correct tab via $tabId
'
,
({
index
,
tabId
})
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentTabIndex
:
index
});
expect
(
$router
.
replace
).
toHaveBeenCalledWith
({
name
:
'
tab
'
,
params
:
{
tabId
}
});
});
...
...
spec/frontend/vue_shared/alert_details/sidebar/alert_sidebar_assignees_spec.js
View file @
6a0d815d
...
...
@@ -109,6 +109,8 @@ describe('Alert Details Sidebar Assignees', () => {
});
it
(
'
renders a unassigned option
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isDropdownSearching
:
false
});
await
wrapper
.
vm
.
$nextTick
();
expect
(
findDropdown
().
text
()).
toBe
(
'
Unassigned
'
);
...
...
@@ -120,6 +122,8 @@ describe('Alert Details Sidebar Assignees', () => {
it
(
'
calls `$apollo.mutate` with `AlertSetAssignees` mutation and variables containing `iid`, `assigneeUsernames`, & `projectPath`
'
,
async
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
.
$apollo
,
'
mutate
'
).
mockResolvedValue
(
mockUpdatedMutationResult
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isDropdownSearching
:
false
});
await
wrapper
.
vm
.
$nextTick
();
...
...
@@ -136,6 +140,8 @@ describe('Alert Details Sidebar Assignees', () => {
});
it
(
'
emits an error when request contains error messages
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
isDropdownSearching
:
false
});
const
errorMutationResult
=
{
data
:
{
...
...
spec/frontend/vue_shared/components/chronic_duration_input_spec.js
View file @
6a0d815d
...
...
@@ -315,6 +315,8 @@ describe('vue_shared/components/chronic_duration_input', () => {
});
it
(
'
passes updated prop via v-model
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
value
:
MOCK_VALUE
});
await
wrapper
.
vm
.
$nextTick
();
...
...
spec/frontend/vue_shared/components/filtered_search_bar/filtered_search_bar_root_spec.js
View file @
6a0d815d
...
...
@@ -122,6 +122,8 @@ describe('FilteredSearchBarRoot', () => {
describe
(
'
sortDirectionIcon
'
,
()
=>
{
it
(
'
returns string "sort-lowest" when `selectedSortDirection` is "ascending"
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
selectedSortDirection
:
SortDirection
.
ascending
,
});
...
...
@@ -130,6 +132,8 @@ describe('FilteredSearchBarRoot', () => {
});
it
(
'
returns string "sort-highest" when `selectedSortDirection` is "descending"
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
selectedSortDirection
:
SortDirection
.
descending
,
});
...
...
@@ -140,6 +144,8 @@ describe('FilteredSearchBarRoot', () => {
describe
(
'
sortDirectionTooltip
'
,
()
=>
{
it
(
'
returns string "Sort direction: Ascending" when `selectedSortDirection` is "ascending"
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
selectedSortDirection
:
SortDirection
.
ascending
,
});
...
...
@@ -148,6 +154,8 @@ describe('FilteredSearchBarRoot', () => {
});
it
(
'
returns string "Sort direction: Descending" when `selectedSortDirection` is "descending"
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
selectedSortDirection
:
SortDirection
.
descending
,
});
...
...
@@ -158,6 +166,8 @@ describe('FilteredSearchBarRoot', () => {
describe
(
'
filteredRecentSearches
'
,
()
=>
{
it
(
'
returns array of recent searches filtering out any string type (unsupported) items
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
recentSearches
:
[{
foo
:
'
bar
'
},
'
foo
'
],
});
...
...
@@ -169,6 +179,8 @@ describe('FilteredSearchBarRoot', () => {
});
it
(
'
returns array of recent searches sanitizing any duplicate token values
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
recentSearches
:
[
[
tokenValueAuthor
,
tokenValueLabel
,
tokenValueMilestone
,
tokenValueLabel
],
...
...
@@ -198,6 +210,8 @@ describe('FilteredSearchBarRoot', () => {
describe
(
'
filterValue
'
,
()
=>
{
it
(
'
emits component event `onFilter` with empty array and false when filter was never selected
'
,
()
=>
{
wrapper
=
createComponent
({
initialFilterValue
:
[
tokenValueEmpty
]
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
initialRender
:
false
,
filterValue
:
[
tokenValueEmpty
],
...
...
@@ -210,6 +224,8 @@ describe('FilteredSearchBarRoot', () => {
it
(
'
emits component event `onFilter` with empty array and true when initially selected filter value was cleared
'
,
()
=>
{
wrapper
=
createComponent
({
initialFilterValue
:
[
tokenValueLabel
]
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
initialRender
:
false
,
filterValue
:
[
tokenValueEmpty
],
...
...
@@ -264,6 +280,8 @@ describe('FilteredSearchBarRoot', () => {
describe
(
'
handleSortDirectionClick
'
,
()
=>
{
beforeEach
(()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
selectedSortOption
:
mockSortOptions
[
0
],
});
...
...
@@ -312,6 +330,8 @@ describe('FilteredSearchBarRoot', () => {
const
mockFilters
=
[
tokenValueAuthor
,
'
foo
'
];
beforeEach
(
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
filterValue
:
mockFilters
,
});
...
...
@@ -376,6 +396,8 @@ describe('FilteredSearchBarRoot', () => {
describe
(
'
template
'
,
()
=>
{
beforeEach
(()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
selectedSortOption
:
mockSortOptions
[
0
],
selectedSortDirection
:
SortDirection
.
descending
,
...
...
spec/frontend/vue_shared/components/filtered_search_bar/tokens/author_token_spec.js
View file @
6a0d815d
...
...
@@ -227,6 +227,8 @@ describe('AuthorToken', () => {
expect
(
getAvatarEl
().
props
(
'
src
'
)).
toBe
(
mockAuthors
[
0
].
avatar_url
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
authors
:
[
{
...
...
spec/frontend/vue_shared/components/filtered_search_bar/tokens/branch_token_spec.js
View file @
6a0d815d
...
...
@@ -121,6 +121,8 @@ describe('BranchToken', () => {
beforeEach
(
async
()
=>
{
wrapper
=
createComponent
({
value
:
{
data
:
mockBranches
[
0
].
name
}
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
branches
:
mockBranches
,
});
...
...
spec/frontend/vue_shared/components/filtered_search_bar/tokens/emoji_token_spec.js
View file @
6a0d815d
...
...
@@ -123,6 +123,8 @@ describe('EmojiToken', () => {
value
:
{
data
:
`"
${
mockEmojis
[
0
].
name
}
"`
},
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
emojis
:
mockEmojis
,
});
...
...
spec/frontend/vue_shared/components/filtered_search_bar/tokens/label_token_spec.js
View file @
6a0d815d
...
...
@@ -144,6 +144,8 @@ describe('LabelToken', () => {
beforeEach
(
async
()
=>
{
wrapper
=
createComponent
({
value
:
{
data
:
`"
${
mockRegularLabel
.
title
}
"`
}
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
labels
:
mockLabels
,
});
...
...
spec/frontend/vue_shared/components/filtered_search_bar/tokens/milestone_token_spec.js
View file @
6a0d815d
...
...
@@ -121,6 +121,8 @@ describe('MilestoneToken', () => {
beforeEach
(
async
()
=>
{
wrapper
=
createComponent
({
value
:
{
data
:
`"
${
mockRegularMilestone
.
title
}
"`
}
});
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
milestones
:
mockMilestones
,
});
...
...
spec/frontend/vue_shared/components/paginated_table_with_search_and_tabs/paginated_table_with_search_and_tabs_spec.js
View file @
6a0d815d
...
...
@@ -313,6 +313,8 @@ describe('AlertManagementEmptyState', () => {
it
(
'
returns correctly applied filter search values
'
,
async
()
=>
{
const
searchTerm
=
'
foo
'
;
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
searchTerm
,
});
...
...
@@ -330,6 +332,8 @@ describe('AlertManagementEmptyState', () => {
});
it
(
'
updates props `searchTerm` and `authorUsername` with empty values when passed filters param is empty
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
authorUsername
:
'
foo
'
,
searchTerm
:
'
bar
'
,
...
...
spec/frontend/vue_shared/components/sidebar/issuable_move_dropdown_spec.js
View file @
6a0d815d
...
...
@@ -68,6 +68,8 @@ describe('IssuableMoveDropdown', () => {
describe
(
'
searchKey
'
,
()
=>
{
it
(
'
calls `fetchProjects` with value of the prop
'
,
async
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
fetchProjects
'
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
searchKey
:
'
foo
'
,
});
...
...
@@ -143,6 +145,8 @@ describe('IssuableMoveDropdown', () => {
`
(
'
returns $returnValue when selectedProject and provided project param $title
'
,
async
({
project
,
selectedProject
,
returnValue
})
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
selectedProject
,
});
...
...
@@ -154,6 +158,8 @@ describe('IssuableMoveDropdown', () => {
);
it
(
'
returns false when selectedProject is null
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
selectedProject
:
null
,
});
...
...
@@ -206,6 +212,8 @@ describe('IssuableMoveDropdown', () => {
});
it
(
'
renders gl-loading-icon component when projectsListLoading prop is true
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
projectsListLoading
:
true
,
});
...
...
@@ -216,6 +224,8 @@ describe('IssuableMoveDropdown', () => {
});
it
(
'
renders gl-dropdown-item components for available projects
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
projects
:
mockProjects
,
selectedProject
:
mockProjects
[
0
],
...
...
@@ -234,6 +244,8 @@ describe('IssuableMoveDropdown', () => {
});
it
(
'
renders string "No matching results" when search does not yield any matches
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
searchKey
:
'
foo
'
,
});
...
...
@@ -241,6 +253,8 @@ describe('IssuableMoveDropdown', () => {
// Wait for `searchKey` watcher to run.
await
wrapper
.
vm
.
$nextTick
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
projects
:
[],
projectsListLoading
:
false
,
...
...
@@ -254,6 +268,8 @@ describe('IssuableMoveDropdown', () => {
});
it
(
'
renders string "Failed to load projects" when loading projects list fails
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
projects
:
[],
projectsListLoading
:
false
,
...
...
@@ -273,6 +289,8 @@ describe('IssuableMoveDropdown', () => {
expect
(
moveButtonEl
.
text
()).
toBe
(
'
Move
'
);
expect
(
moveButtonEl
.
attributes
(
'
disabled
'
)).
toBe
(
'
true
'
);
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
selectedProject
:
mockProjects
[
0
],
});
...
...
@@ -303,6 +321,8 @@ describe('IssuableMoveDropdown', () => {
});
it
(
'
gl-dropdown component prevents dropdown body from closing on `hide` event when `projectItemClick` prop is true
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
projectItemClick
:
true
,
});
...
...
@@ -326,6 +346,8 @@ describe('IssuableMoveDropdown', () => {
});
it
(
'
sets project for clicked gl-dropdown-item to selectedProject
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
projects
:
mockProjects
,
});
...
...
@@ -338,6 +360,8 @@ describe('IssuableMoveDropdown', () => {
});
it
(
'
hides dropdown and emits `move-issuable` event when move button is clicked
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
selectedProject
:
mockProjects
[
0
],
});
...
...
spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_create_view_spec.js
View file @
6a0d815d
...
...
@@ -43,6 +43,8 @@ describe('DropdownContentsCreateView', () => {
});
it
(
'
returns `true` when `labelCreateInProgress` is true
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
labelTitle
:
'
Foo
'
,
selectedColor
:
'
#ff0000
'
,
...
...
@@ -55,6 +57,8 @@ describe('DropdownContentsCreateView', () => {
});
it
(
'
returns `false` when label title and color is defined and create request is not already in progress
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
labelTitle
:
'
Foo
'
,
selectedColor
:
'
#ff0000
'
,
...
...
@@ -99,6 +103,8 @@ describe('DropdownContentsCreateView', () => {
describe
(
'
handleCreateClick
'
,
()
=>
{
it
(
'
calls action `createLabel` with object containing `labelTitle` & `selectedColor`
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
createLabel
'
).
mockImplementation
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
labelTitle
:
'
Foo
'
,
selectedColor
:
'
#ff0000
'
,
...
...
@@ -164,6 +170,8 @@ describe('DropdownContentsCreateView', () => {
});
it
(
'
renders color input element
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
selectedColor
:
'
#ff0000
'
,
});
...
...
spec/frontend/vue_shared/components/sidebar/labels_select_vue/dropdown_contents_labels_view_spec.js
View file @
6a0d815d
...
...
@@ -63,6 +63,8 @@ describe('DropdownContentsLabelsView', () => {
describe
(
'
computed
'
,
()
=>
{
describe
(
'
visibleLabels
'
,
()
=>
{
it
(
'
returns matching labels filtered with `searchKey`
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
searchKey
:
'
bug
'
,
});
...
...
@@ -72,6 +74,8 @@ describe('DropdownContentsLabelsView', () => {
});
it
(
'
returns matching labels with fuzzy filtering
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
searchKey
:
'
bg
'
,
});
...
...
@@ -82,6 +86,8 @@ describe('DropdownContentsLabelsView', () => {
});
it
(
'
returns all labels when `searchKey` is empty
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
searchKey
:
''
,
});
...
...
@@ -100,6 +106,8 @@ describe('DropdownContentsLabelsView', () => {
`
(
'
returns $returnValue when searchKey is "$searchKey" and visibleLabels is $labelsDescription
'
,
async
({
searchKey
,
labels
,
returnValue
})
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
searchKey
,
});
...
...
@@ -161,6 +169,8 @@ describe('DropdownContentsLabelsView', () => {
describe
(
'
handleKeyDown
'
,
()
=>
{
it
(
'
decreases `currentHighlightItem` value by 1 when Up arrow key is pressed
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentHighlightItem
:
1
,
});
...
...
@@ -173,6 +183,8 @@ describe('DropdownContentsLabelsView', () => {
});
it
(
'
increases `currentHighlightItem` value by 1 when Down arrow key is pressed
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentHighlightItem
:
1
,
});
...
...
@@ -185,6 +197,8 @@ describe('DropdownContentsLabelsView', () => {
});
it
(
'
resets the search text when the Enter key is pressed
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentHighlightItem
:
1
,
searchKey
:
'
bug
'
,
...
...
@@ -201,6 +215,8 @@ describe('DropdownContentsLabelsView', () => {
it
(
'
calls action `updateSelectedLabels` with currently highlighted label when Enter key is pressed
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
updateSelectedLabels
'
).
mockImplementation
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentHighlightItem
:
2
,
});
...
...
@@ -220,6 +236,8 @@ describe('DropdownContentsLabelsView', () => {
it
(
'
calls action `toggleDropdownContents` when Esc key is pressed
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
toggleDropdownContents
'
).
mockImplementation
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentHighlightItem
:
1
,
});
...
...
@@ -233,6 +251,8 @@ describe('DropdownContentsLabelsView', () => {
it
(
'
calls action `scrollIntoViewIfNeeded` in next tick when any key is pressed
'
,
()
=>
{
jest
.
spyOn
(
wrapper
.
vm
,
'
scrollIntoViewIfNeeded
'
).
mockImplementation
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentHighlightItem
:
1
,
});
...
...
@@ -320,6 +340,8 @@ describe('DropdownContentsLabelsView', () => {
});
it
(
'
renders label element with `highlight` set to true when value of `currentHighlightItem` is more than -1
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
currentHighlightItem
:
0
,
});
...
...
@@ -332,6 +354,8 @@ describe('DropdownContentsLabelsView', () => {
});
it
(
'
renders element containing "No matching results" when `searchKey` does not match with any label
'
,
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
searchKey
:
'
abc
'
,
});
...
...
spec/frontend/vue_shared/directives/track_event_spec.js
View file @
6a0d815d
...
...
@@ -38,6 +38,8 @@ describe('Error Tracking directive', () => {
label
:
'
Trackable Info
'
,
};
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
trackingOptions
});
const
{
category
,
action
,
label
,
property
,
value
}
=
trackingOptions
;
...
...
spec/frontend/vue_shared/issuable/list/components/issuable_list_root_spec.js
View file @
6a0d815d
...
...
@@ -98,6 +98,8 @@ describe('IssuableListRoot', () => {
await
wrapper
.
vm
.
$nextTick
();
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
checkedIssuables
,
});
...
...
@@ -111,6 +113,8 @@ describe('IssuableListRoot', () => {
describe
(
'
bulkEditIssuables
'
,
()
=>
{
it
(
'
returns array of issuables which have `checked` set to true within checkedIssuables map
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
checkedIssuables
:
mockCheckedIssuables
,
});
...
...
@@ -180,6 +184,8 @@ describe('IssuableListRoot', () => {
describe
(
'
issuableChecked
'
,
()
=>
{
it
(
'
returns boolean value representing checked status of issuable item
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
checkedIssuables
:
{
[
mockIssuables
[
0
].
iid
]:
{
checked
:
true
,
issuable
:
mockIssuables
[
0
]
},
...
...
spec/frontend/vue_shared/issuable/show/components/issuable_title_spec.js
View file @
6a0d815d
...
...
@@ -84,6 +84,8 @@ describe('IssuableTitle', () => {
});
it
(
'
renders sticky header when `stickyTitleVisible` prop is true
'
,
async
()
=>
{
// setData usage is discouraged. See https://gitlab.com/groups/gitlab-org/-/epics/7330 for details
// eslint-disable-next-line no-restricted-syntax
wrapper
.
setData
({
stickyTitleVisible
:
true
,
});
...
...
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