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
54d8e51b
Commit
54d8e51b
authored
Jan 24, 2022
by
Stanislav Lashmanov
Committed by
Natalia Tepluhina
Jan 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove localVue usage from tests with GraphQL mocks
parent
c40e2875
Changes
103
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
103 changed files
with
347 additions
and
500 deletions
+347
-500
ee/spec/frontend/boards/components/assignee_select_spec.js
ee/spec/frontend/boards/components/assignee_select_spec.js
+4
-5
ee/spec/frontend/boards/components/labels_select_spec.js
ee/spec/frontend/boards/components/labels_select_spec.js
+4
-5
ee/spec/frontend/boards/milestone_select_spec.js
ee/spec/frontend/boards/milestone_select_spec.js
+4
-5
ee/spec/frontend/ci_minutes_usage/components/app_spec.js
ee/spec/frontend/ci_minutes_usage/components/app_spec.js
+3
-4
ee/spec/frontend/codequality_report/codequality_report_graphql_spec.js
...end/codequality_report/codequality_report_graphql_spec.js
+3
-4
ee/spec/frontend/commit_box/components/commit_box_pipeline_mini_graph_spec.js
...mit_box/components/commit_box_pipeline_mini_graph_spec.js
+3
-4
ee/spec/frontend/escalation_policies/delete_escalation_policy_modal_spec.js
...scalation_policies/delete_escalation_policy_modal_spec.js
+3
-4
ee/spec/frontend/external_issues_list/components/external_issues_list_root_spec.js
..._issues_list/components/external_issues_list_root_spec.js
+3
-7
ee/spec/frontend/groups/settings/compliance_frameworks/components/create_form_spec.js
...ings/compliance_frameworks/components/create_form_spec.js
+4
-5
ee/spec/frontend/groups/settings/compliance_frameworks/components/delete_modal_spec.js
...ngs/compliance_frameworks/components/delete_modal_spec.js
+4
-5
ee/spec/frontend/groups/settings/compliance_frameworks/components/edit_form_spec.js
...ttings/compliance_frameworks/components/edit_form_spec.js
+4
-5
ee/spec/frontend/groups/settings/compliance_frameworks/components/list_spec.js
...ps/settings/compliance_frameworks/components/list_spec.js
+5
-6
ee/spec/frontend/hand_raise_leads/components/hand_raise_lead_button_spec.js
...and_raise_leads/components/hand_raise_lead_button_spec.js
+2
-4
ee/spec/frontend/iterations/components/iteration_cadence_list_item_spec.js
...iterations/components/iteration_cadence_list_item_spec.js
+4
-6
ee/spec/frontend/iterations/components/iteration_cadences_list_spec.js
...end/iterations/components/iteration_cadences_list_spec.js
+2
-6
ee/spec/frontend/iterations/components/iteration_report_spec.js
...c/frontend/iterations/components/iteration_report_spec.js
+3
-4
ee/spec/frontend/on_demand_scans/components/tabs/base_tab_spec.js
...frontend/on_demand_scans/components/tabs/base_tab_spec.js
+2
-5
ee/spec/frontend/oncall_schedule/oncall_schedule_spec.js
ee/spec/frontend/oncall_schedule/oncall_schedule_spec.js
+3
-5
ee/spec/frontend/oncall_schedule/oncall_schedule_wrapper_spec.js
.../frontend/oncall_schedule/oncall_schedule_wrapper_spec.js
+4
-6
ee/spec/frontend/pipeline_editor/components/header/pipeline_editor_mini_graph_spec.js
...itor/components/header/pipeline_editor_mini_graph_spec.js
+3
-4
ee/spec/frontend/project_quality_summary/app_spec.js
ee/spec/frontend/project_quality_summary/app_spec.js
+2
-4
ee/spec/frontend/repository/components/code_owners_spec.js
ee/spec/frontend/repository/components/code_owners_spec.js
+3
-5
ee/spec/frontend/repository/components/lock_button_spec.js
ee/spec/frontend/repository/components/lock_button_spec.js
+4
-5
ee/spec/frontend/runner/components/runner_update_form_spec.js
...pec/frontend/runner/components/runner_update_form_spec.js
+12
-9
ee/spec/frontend/security_configuration/dast_profiles/components/base_dast_profile_form_spec.js
...n/dast_profiles/components/base_dast_profile_form_spec.js
+2
-4
ee/spec/frontend/security_configuration/dast_profiles/components/dast_failed_site_validations_spec.js
..._profiles/components/dast_failed_site_validations_spec.js
+3
-5
ee/spec/frontend/security_configuration/dast_profiles/components/dast_site_profiles_list_spec.js
.../dast_profiles/components/dast_site_profiles_list_spec.js
+4
-5
ee/spec/frontend/security_configuration/dast_profiles/dast_site_validation/components/dast_site_validation_modal_spec.js
..._validation/components/dast_site_validation_modal_spec.js
+3
-4
ee/spec/frontend/security_dashboard/components/instance/project_list_spec.js
...curity_dashboard/components/instance/project_list_spec.js
+3
-4
ee/spec/frontend/security_dashboard/components/pipeline/pipeline_findings_spec.js
...y_dashboard/components/pipeline/pipeline_findings_spec.js
+4
-6
ee/spec/frontend/security_dashboard/components/pipeline/pipeline_security_dashboard_spec.js
...d/components/pipeline/pipeline_security_dashboard_spec.js
+4
-5
ee/spec/frontend/security_dashboard/components/project/project_security_dashboard_spec.js
...ard/components/project/project_security_dashboard_spec.js
+3
-4
ee/spec/frontend/security_dashboard/components/project/project_vulnerability_report_spec.js
...d/components/project/project_vulnerability_report_spec.js
+5
-6
ee/spec/frontend/security_dashboard/components/shared/project_security_status_chart_spec.js
...d/components/shared/project_security_status_chart_spec.js
+3
-4
ee/spec/frontend/security_dashboard/components/shared/selection_summary_spec.js
...ity_dashboard/components/shared/selection_summary_spec.js
+3
-4
ee/spec/frontend/security_dashboard/components/shared/vulnerability_report/vulnerability_counts_spec.js
.../shared/vulnerability_report/vulnerability_counts_spec.js
+3
-5
ee/spec/frontend/security_dashboard/components/shared/vulnerability_report/vulnerability_list_graphql_spec.js
...d/vulnerability_report/vulnerability_list_graphql_spec.js
+3
-5
ee/spec/frontend/sidebar/components/iteration_dropdown_spec.js
...ec/frontend/sidebar/components/iteration_dropdown_spec.js
+3
-5
ee/spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js
...ontend/sidebar/components/sidebar_dropdown_widget_spec.js
+3
-5
ee/spec/frontend/sidebar/components/status/sidebar_status_spec.js
...frontend/sidebar/components/status/sidebar_status_spec.js
+3
-4
ee/spec/frontend/subscriptions/buy_addons_shared/app_spec.js
ee/spec/frontend/subscriptions/buy_addons_shared/app_spec.js
+2
-4
ee/spec/frontend/subscriptions/buy_addons_shared/components/checkout/addon_purchase_details_spec.js
...shared/components/checkout/addon_purchase_details_spec.js
+2
-4
ee/spec/frontend/subscriptions/buy_addons_shared/components/checkout_spec.js
...bscriptions/buy_addons_shared/components/checkout_spec.js
+2
-4
ee/spec/frontend/subscriptions/buy_addons_shared/components/order_summary_spec.js
...ptions/buy_addons_shared/components/order_summary_spec.js
+2
-4
ee/spec/frontend/subscriptions/buy_minutes/components/checkout/billing_address_spec.js
...s/buy_minutes/components/checkout/billing_address_spec.js
+3
-4
ee/spec/frontend/subscriptions/buy_minutes/components/checkout/confirm_order_spec.js
...ons/buy_minutes/components/checkout/confirm_order_spec.js
+3
-4
ee/spec/frontend/subscriptions/new/components/checkout/billing_address_spec.js
...criptions/new/components/checkout/billing_address_spec.js
+5
-6
ee/spec/frontend/subscriptions/new/components/checkout/confirm_order_spec.js
...bscriptions/new/components/checkout/confirm_order_spec.js
+4
-5
ee/spec/frontend/subscriptions/new/components/checkout/payment_method_spec.js
...scriptions/new/components/checkout/payment_method_spec.js
+4
-6
ee/spec/frontend/subscriptions/new/components/checkout/subscription_details_spec.js
...ions/new/components/checkout/subscription_details_spec.js
+4
-6
ee/spec/frontend/threat_monitoring/components/instance_project_selector_spec.js
...t_monitoring/components/instance_project_selector_spec.js
+2
-4
ee/spec/frontend/threat_monitoring/components/policies/policies_list_spec.js
...reat_monitoring/components/policies/policies_list_spec.js
+2
-4
ee/spec/frontend/threat_monitoring/components/policies/scan_new_policy_modal_spec.js
...itoring/components/policies/scan_new_policy_modal_spec.js
+2
-4
ee/spec/frontend/threat_monitoring/components/policy_editor/policy_alert_picker_spec.js
...ring/components/policy_editor/policy_alert_picker_spec.js
+3
-4
ee/spec/frontend/trials/components/country_or_region_selector_spec.js
...tend/trials/components/country_or_region_selector_spec.js
+2
-4
ee/spec/frontend/usage_quotas/storage/components/project_storage_app_spec.js
...age_quotas/storage/components/project_storage_app_spec.js
+3
-4
ee/spec/frontend/vue_shared/discover/card_security_discover_app_spec.js
...nd/vue_shared/discover/card_security_discover_app_spec.js
+3
-4
ee/spec/frontend/vulnerabilities/header_spec.js
ee/spec/frontend/vulnerabilities/header_spec.js
+3
-4
ee/spec/frontend/vulnerabilities/vulnerability_spec.js
ee/spec/frontend/vulnerabilities/vulnerability_spec.js
+3
-4
spec/frontend/alerts_settings/components/alerts_settings_wrapper_spec.js
...lerts_settings/components/alerts_settings_wrapper_spec.js
+3
-5
spec/frontend/artifacts_settings/components/keep_latest_artifact_checkbox_spec.js
...settings/components/keep_latest_artifact_checkbox_spec.js
+3
-4
spec/frontend/boards/board_list_helper.js
spec/frontend/boards/board_list_helper.js
+4
-5
spec/frontend/clusters_list/components/install_agent_modal_spec.js
...tend/clusters_list/components/install_agent_modal_spec.js
+2
-4
spec/frontend/design_management/pages/index_spec.js
spec/frontend/design_management/pages/index_spec.js
+5
-7
spec/frontend/issues/list/components/new_issue_dropdown_spec.js
...rontend/issues/list/components/new_issue_dropdown_spec.js
+3
-4
spec/frontend/issues/show/components/fields/type_spec.js
spec/frontend/issues/show/components/fields/type_spec.js
+3
-4
spec/frontend/jira_connect/branches/components/new_branch_form_spec.js
.../jira_connect/branches/components/new_branch_form_spec.js
+3
-5
spec/frontend/jira_connect/branches/components/project_dropdown_spec.js
...jira_connect/branches/components/project_dropdown_spec.js
+3
-5
spec/frontend/jira_connect/branches/components/source_branch_dropdown_spec.js
...onnect/branches/components/source_branch_dropdown_spec.js
+3
-5
spec/frontend/jobs/bridge/app_spec.js
spec/frontend/jobs/bridge/app_spec.js
+4
-6
spec/frontend/jobs/components/table/job_table_app_spec.js
spec/frontend/jobs/components/table/job_table_app_spec.js
+3
-4
spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_spec.js
...gistry/explorer/components/details_page/tags_list_spec.js
+3
-6
spec/frontend/packages_and_registries/container_registry/explorer/pages/details_spec.js
...istries/container_registry/explorer/pages/details_spec.js
+4
-6
spec/frontend/packages_and_registries/container_registry/explorer/pages/list_spec.js
...registries/container_registry/explorer/pages/list_spec.js
+4
-6
spec/frontend/packages_and_registries/dependency_proxy/app_spec.js
...tend/packages_and_registries/dependency_proxy/app_spec.js
+2
-5
spec/frontend/packages_and_registries/package_registry/components/functional/delete_package_spec.js
...age_registry/components/functional/delete_package_spec.js
+2
-5
spec/frontend/packages_and_registries/package_registry/pages/details_spec.js
...ges_and_registries/package_registry/pages/details_spec.js
+3
-6
spec/frontend/packages_and_registries/package_registry/pages/list_spec.js
...ckages_and_registries/package_registry/pages/list_spec.js
+3
-6
spec/frontend/packages_and_registries/settings/group/components/dependency_proxy_settings_spec.js
...ttings/group/components/dependency_proxy_settings_spec.js
+2
-5
spec/frontend/packages_and_registries/settings/group/components/group_settings_app_spec.js
...ries/settings/group/components/group_settings_app_spec.js
+4
-6
spec/frontend/packages_and_registries/settings/group/components/package_settings_spec.js
...stries/settings/group/components/package_settings_spec.js
+2
-5
spec/frontend/packages_and_registries/settings/project/settings/components/registry_settings_app_spec.js
...project/settings/components/registry_settings_app_spec.js
+3
-5
spec/frontend/pipeline_editor/components/header/pipeline_status_spec.js
...pipeline_editor/components/header/pipeline_status_spec.js
+3
-4
spec/frontend/pipeline_editor/components/header/pipline_editor_mini_graph_spec.js
...ditor/components/header/pipline_editor_mini_graph_spec.js
+3
-4
spec/frontend/pipeline_editor/components/header/validation_segment_spec.js
...eline_editor/components/header/validation_segment_spec.js
+3
-4
spec/frontend/pipelines/components/jobs/jobs_app_spec.js
spec/frontend/pipelines/components/jobs/jobs_app_spec.js
+3
-4
spec/frontend/pipelines/graph/linked_pipelines_column_spec.js
.../frontend/pipelines/graph/linked_pipelines_column_spec.js
+3
-4
spec/frontend/projects/pipelines/charts/components/pipeline_charts_spec.js
...jects/pipelines/charts/components/pipeline_charts_spec.js
+3
-4
spec/frontend/repository/components/blob_content_viewer_spec.js
...rontend/repository/components/blob_content_viewer_spec.js
+4
-5
spec/frontend/repository/components/blob_controls_spec.js
spec/frontend/repository/components/blob_controls_spec.js
+3
-6
spec/frontend/runner/admin_runner_edit/admin_runner_edit_app_spec.js
...nd/runner/admin_runner_edit/admin_runner_edit_app_spec.js
+3
-4
spec/frontend/runner/components/registration/registration_dropdown_spec.js
...ner/components/registration/registration_dropdown_spec.js
+20
-19
spec/frontend/runner/components/registration/registration_token_reset_dropdown_item_spec.js
...gistration/registration_token_reset_dropdown_item_spec.js
+4
-3
spec/frontend/runner/group_runners/group_runners_app_spec.js
spec/frontend/runner/group_runners/group_runners_app_spec.js
+1
-0
spec/frontend/sidebar/assignees_realtime_spec.js
spec/frontend/sidebar/assignees_realtime_spec.js
+3
-4
spec/frontend/sidebar/components/assignees/sidebar_assignees_widget_spec.js
...bar/components/assignees/sidebar_assignees_widget_spec.js
+4
-5
spec/frontend/sidebar/components/confidential/sidebar_confidentiality_widget_spec.js
...nents/confidential/sidebar_confidentiality_widget_spec.js
+4
-5
spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js
...ontend/sidebar/components/sidebar_dropdown_widget_spec.js
+3
-5
spec/frontend/sidebar/components/time_tracking/report_spec.js
.../frontend/sidebar/components/time_tracking/report_spec.js
+3
-4
spec/frontend/snippets/components/edit_spec.js
spec/frontend/snippets/components/edit_spec.js
+4
-5
spec/frontend/terraform/components/states_table_actions_spec.js
...rontend/terraform/components/states_table_actions_spec.js
+3
-4
spec/frontend/terraform/components/terraform_list_spec.js
spec/frontend/terraform/components/terraform_list_spec.js
+3
-4
spec/frontend/token_access/token_access_spec.js
spec/frontend/token_access/token_access_spec.js
+2
-4
No files found.
ee/spec/frontend/boards/components/assignee_select_spec.js
View file @
54d8e51b
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
AssigneeSelect
from
'
ee/boards/components/assignee_select.vue
'
;
import
AssigneeSelect
from
'
ee/boards/components/assignee_select.vue
'
;
...
@@ -17,8 +18,7 @@ import searchProjectUsersQuery from '~/graphql_shared/queries/users_search.query
...
@@ -17,8 +18,7 @@ import searchProjectUsersQuery from '~/graphql_shared/queries/users_search.query
import
{
ASSIGNEES_DEBOUNCE_DELAY
}
from
'
~/sidebar/constants
'
;
import
{
ASSIGNEES_DEBOUNCE_DELAY
}
from
'
~/sidebar/constants
'
;
import
DropdownWidget
from
'
~/vue_shared/components/dropdown/dropdown_widget/dropdown_widget.vue
'
;
import
DropdownWidget
from
'
~/vue_shared/components/dropdown/dropdown_widget/dropdown_widget.vue
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Assignee select component
'
,
()
=>
{
describe
(
'
Assignee select component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -51,7 +51,6 @@ describe('Assignee select component', () => {
...
@@ -51,7 +51,6 @@ describe('Assignee select component', () => {
[
searchGroupUsersQuery
,
groupUsersQueryHandlerSuccess
],
[
searchGroupUsersQuery
,
groupUsersQueryHandlerSuccess
],
]);
]);
wrapper
=
shallowMount
(
AssigneeSelect
,
{
wrapper
=
shallowMount
(
AssigneeSelect
,
{
localVue
,
store
,
store
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
propsData
:
{
propsData
:
{
...
...
ee/spec/frontend/boards/components/labels_select_spec.js
View file @
54d8e51b
import
{
GlButton
,
GlDropdown
,
GlDropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlDropdown
,
GlDropdownItem
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
LabelsSelect
from
'
ee/boards/components/labels_select.vue
'
;
import
LabelsSelect
from
'
ee/boards/components/labels_select.vue
'
;
...
@@ -21,8 +22,7 @@ import searchProjectLabels from '~/vue_shared/components/sidebar/labels_select_w
...
@@ -21,8 +22,7 @@ import searchProjectLabels from '~/vue_shared/components/sidebar/labels_select_w
import
DropdownValue
from
'
~/vue_shared/components/sidebar/labels_select_widget/dropdown_value.vue
'
;
import
DropdownValue
from
'
~/vue_shared/components/sidebar/labels_select_widget/dropdown_value.vue
'
;
import
DropdownWidget
from
'
~/vue_shared/components/dropdown/dropdown_widget/dropdown_widget.vue
'
;
import
DropdownWidget
from
'
~/vue_shared/components/dropdown/dropdown_widget/dropdown_widget.vue
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Labels select component
'
,
()
=>
{
describe
(
'
Labels select component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -64,7 +64,6 @@ describe('Labels select component', () => {
...
@@ -64,7 +64,6 @@ describe('Labels select component', () => {
[
searchGroupLabels
,
groupLabelsQueryHandlerSuccess
],
[
searchGroupLabels
,
groupLabelsQueryHandlerSuccess
],
]);
]);
wrapper
=
shallowMount
(
LabelsSelect
,
{
wrapper
=
shallowMount
(
LabelsSelect
,
{
localVue
,
store
,
store
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
propsData
:
{
propsData
:
{
...
...
ee/spec/frontend/boards/milestone_select_spec.js
View file @
54d8e51b
import
{
GlButton
,
GlDropdown
,
GlDropdownItem
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlDropdown
,
GlDropdownItem
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
MilestoneSelect
from
'
ee/boards/components/milestone_select.vue
'
;
import
MilestoneSelect
from
'
ee/boards/components/milestone_select.vue
'
;
...
@@ -20,8 +21,7 @@ import groupMilestonesQuery from '~/sidebar/queries/group_milestones.query.graph
...
@@ -20,8 +21,7 @@ import groupMilestonesQuery from '~/sidebar/queries/group_milestones.query.graph
import
projectMilestonesQuery
from
'
~/sidebar/queries/project_milestones.query.graphql
'
;
import
projectMilestonesQuery
from
'
~/sidebar/queries/project_milestones.query.graphql
'
;
import
DropdownWidget
from
'
~/vue_shared/components/dropdown/dropdown_widget/dropdown_widget.vue
'
;
import
DropdownWidget
from
'
~/vue_shared/components/dropdown/dropdown_widget/dropdown_widget.vue
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Milestone select component
'
,
()
=>
{
describe
(
'
Milestone select component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -54,7 +54,6 @@ describe('Milestone select component', () => {
...
@@ -54,7 +54,6 @@ describe('Milestone select component', () => {
[
groupMilestonesQuery
,
groupUsersQueryHandlerSuccess
],
[
groupMilestonesQuery
,
groupUsersQueryHandlerSuccess
],
]);
]);
wrapper
=
shallowMount
(
MilestoneSelect
,
{
wrapper
=
shallowMount
(
MilestoneSelect
,
{
localVue
,
store
,
store
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
propsData
:
{
propsData
:
{
...
...
ee/spec/frontend/ci_minutes_usage/components/app_spec.js
View file @
54d8e51b
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
CiMinutesUsageApp
from
'
ee/ci_minutes_usage/components/app.vue
'
;
import
CiMinutesUsageApp
from
'
ee/ci_minutes_usage/components/app.vue
'
;
import
MinutesUsageMonthChart
from
'
ee/ci_minutes_usage/components/minutes_usage_month_chart.vue
'
;
import
MinutesUsageMonthChart
from
'
ee/ci_minutes_usage/components/minutes_usage_month_chart.vue
'
;
...
@@ -7,8 +8,7 @@ import ciMinutesUsage from 'ee/ci_minutes_usage/graphql/queries/ci_minutes.graph
...
@@ -7,8 +8,7 @@ import ciMinutesUsage from 'ee/ci_minutes_usage/graphql/queries/ci_minutes.graph
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
ciMinutesUsageMockData
}
from
'
../mock_data
'
;
import
{
ciMinutesUsageMockData
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
CI minutes usage app
'
,
()
=>
{
describe
(
'
CI minutes usage app
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -23,7 +23,6 @@ describe('CI minutes usage app', () => {
...
@@ -23,7 +23,6 @@ describe('CI minutes usage app', () => {
const
{
fakeApollo
}
=
options
;
const
{
fakeApollo
}
=
options
;
return
shallowMount
(
CiMinutesUsageApp
,
{
return
shallowMount
(
CiMinutesUsageApp
,
{
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
});
});
}
}
...
...
ee/spec/frontend/codequality_report/codequality_report_graphql_spec.js
View file @
54d8e51b
import
{
GlInfiniteScroll
}
from
'
@gitlab/ui
'
;
import
{
GlInfiniteScroll
}
from
'
@gitlab/ui
'
;
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
@@ -7,8 +8,7 @@ import CodequalityReportApp from 'ee/codequality_report/codequality_report_graph
...
@@ -7,8 +8,7 @@ import CodequalityReportApp from 'ee/codequality_report/codequality_report_graph
import
getCodeQualityViolations
from
'
ee/codequality_report/graphql/queries/get_code_quality_violations.query.graphql
'
;
import
getCodeQualityViolations
from
'
ee/codequality_report/graphql/queries/get_code_quality_violations.query.graphql
'
;
import
{
mockGetCodeQualityViolationsResponse
,
codeQualityViolations
}
from
'
./mock_data
'
;
import
{
mockGetCodeQualityViolationsResponse
,
codeQualityViolations
}
from
'
./mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Codequality report app
'
,
()
=>
{
describe
(
'
Codequality report app
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -20,7 +20,6 @@ describe('Codequality report app', () => {
...
@@ -20,7 +20,6 @@ describe('Codequality report app', () => {
const
apolloProvider
=
createMockApollo
([[
getCodeQualityViolations
,
mockReturnValue
]]);
const
apolloProvider
=
createMockApollo
([[
getCodeQualityViolations
,
mockReturnValue
]]);
wrapper
=
mountFn
(
CodequalityReportApp
,
{
wrapper
=
mountFn
(
CodequalityReportApp
,
{
localVue
,
apolloProvider
,
apolloProvider
,
provide
:
{
provide
:
{
projectPath
:
'
project-path
'
,
projectPath
:
'
project-path
'
,
...
...
ee/spec/frontend/commit_box/components/commit_box_pipeline_mini_graph_spec.js
View file @
54d8e51b
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
...
@@ -16,8 +17,7 @@ import {
...
@@ -16,8 +17,7 @@ import {
const
fullPath
=
'
gitlab-org/gitlab
'
;
const
fullPath
=
'
gitlab-org/gitlab
'
;
const
iid
=
'
315
'
;
const
iid
=
'
315
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
...
@@ -53,7 +53,6 @@ describe('Commit box pipeline mini graph', () => {
...
@@ -53,7 +53,6 @@ describe('Commit box pipeline mini graph', () => {
iid
,
iid
,
dataMethod
:
'
graphql
'
,
dataMethod
:
'
graphql
'
,
},
},
localVue
,
apolloProvider
:
createMockApolloProvider
(
handler
),
apolloProvider
:
createMockApolloProvider
(
handler
),
}),
}),
);
);
...
...
ee/spec/frontend/escalation_policies/delete_escalation_policy_modal_spec.js
View file @
54d8e51b
import
{
GlModal
,
GlAlert
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlModal
,
GlAlert
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
{
cloneDeep
}
from
'
lodash
'
;
import
{
cloneDeep
}
from
'
lodash
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
DeleteEscalationPolicyModal
,
{
import
DeleteEscalationPolicyModal
,
{
...
@@ -20,7 +21,6 @@ import mockPolicies from './mocks/mockPolicies.json';
...
@@ -20,7 +21,6 @@ import mockPolicies from './mocks/mockPolicies.json';
const
projectPath
=
'
group/project
'
;
const
projectPath
=
'
group/project
'
;
const
mutate
=
jest
.
fn
();
const
mutate
=
jest
.
fn
();
const
mockHideModal
=
jest
.
fn
();
const
mockHideModal
=
jest
.
fn
();
const
localVue
=
createLocalVue
();
describe
(
'
DeleteEscalationPolicyModal
'
,
()
=>
{
describe
(
'
DeleteEscalationPolicyModal
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -59,7 +59,7 @@ describe('DeleteEscalationPolicyModal', () => {
...
@@ -59,7 +59,7 @@ describe('DeleteEscalationPolicyModal', () => {
function
createComponentWithApollo
({
function
createComponentWithApollo
({
destroyHandler
=
jest
.
fn
().
mockResolvedValue
(
destroyPolicyResponse
),
destroyHandler
=
jest
.
fn
().
mockResolvedValue
(
destroyPolicyResponse
),
}
=
{})
{
}
=
{})
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
destroyPolicyHandler
=
destroyHandler
;
destroyPolicyHandler
=
destroyHandler
;
const
requestHandlers
=
[
const
requestHandlers
=
[
...
@@ -78,7 +78,6 @@ describe('DeleteEscalationPolicyModal', () => {
...
@@ -78,7 +78,6 @@ describe('DeleteEscalationPolicyModal', () => {
});
});
wrapper
=
shallowMount
(
DeleteEscalationPolicyModal
,
{
wrapper
=
shallowMount
(
DeleteEscalationPolicyModal
,
{
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
propsData
:
{
propsData
:
{
escalationPolicy
:
cachedPolicy
,
escalationPolicy
:
cachedPolicy
,
...
...
ee/spec/frontend/external_issues_list/components/external_issues_list_root_spec.js
View file @
54d8e51b
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
shallowMount
,
createLocalVue
,
mount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
,
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
...
@@ -42,8 +43,6 @@ const resolvedValue = {
...
@@ -42,8 +43,6 @@ const resolvedValue = {
data
:
mockExternalIssues
,
data
:
mockExternalIssues
,
};
};
const
localVue
=
createLocalVue
();
const
resolvers
=
{
const
resolvers
=
{
Query
:
{
Query
:
{
externalIssues
:
jiraIssuesResolver
,
externalIssues
:
jiraIssuesResolver
,
...
@@ -51,7 +50,7 @@ const resolvers = {
...
@@ -51,7 +50,7 @@ const resolvers = {
};
};
function
createMockApolloProvider
(
mockResolvers
=
resolvers
)
{
function
createMockApolloProvider
(
mockResolvers
=
resolvers
)
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
return
createMockApollo
([],
mockResolvers
);
return
createMockApollo
([],
mockResolvers
);
}
}
...
@@ -89,7 +88,6 @@ describe('ExternalIssuesListRoot', () => {
...
@@ -89,7 +88,6 @@ describe('ExternalIssuesListRoot', () => {
initialFilterParams
,
initialFilterParams
,
},
},
provide
,
provide
,
localVue
,
apolloProvider
,
apolloProvider
,
});
});
};
};
...
@@ -183,7 +181,6 @@ describe('ExternalIssuesListRoot', () => {
...
@@ -183,7 +181,6 @@ describe('ExternalIssuesListRoot', () => {
initialFilterParams
:
{},
initialFilterParams
:
{},
},
},
provide
:
mockProvide
,
provide
:
mockProvide
,
localVue
,
apolloProvider
:
createMockApolloProvider
(),
apolloProvider
:
createMockApolloProvider
(),
});
});
await
waitForPromises
();
await
waitForPromises
();
...
@@ -203,7 +200,6 @@ describe('ExternalIssuesListRoot', () => {
...
@@ -203,7 +200,6 @@ describe('ExternalIssuesListRoot', () => {
initialFilterParams
:
{},
initialFilterParams
:
{},
},
},
provide
:
mockProvide
,
provide
:
mockProvide
,
localVue
,
apolloProvider
:
createMockApolloProvider
(),
apolloProvider
:
createMockApolloProvider
(),
});
});
await
waitForPromises
();
await
waitForPromises
();
...
...
ee/spec/frontend/groups/settings/compliance_frameworks/components/create_form_spec.js
View file @
54d8e51b
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
CreateForm
from
'
ee/groups/settings/compliance_frameworks/components/create_form.vue
'
;
import
CreateForm
from
'
ee/groups/settings/compliance_frameworks/components/create_form.vue
'
;
...
@@ -13,8 +14,7 @@ import { visitUrl } from '~/lib/utils/url_utility';
...
@@ -13,8 +14,7 @@ import { visitUrl } from '~/lib/utils/url_utility';
import
{
validCreateResponse
,
errorCreateResponse
}
from
'
../mock_data
'
;
import
{
validCreateResponse
,
errorCreateResponse
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
jest
.
mock
(
'
~/lib/utils/url_utility
'
);
jest
.
mock
(
'
~/lib/utils/url_utility
'
);
...
@@ -38,14 +38,13 @@ describe('CreateForm', () => {
...
@@ -38,14 +38,13 @@ describe('CreateForm', () => {
const
findFormStatus
=
()
=>
wrapper
.
findComponent
(
FormStatus
);
const
findFormStatus
=
()
=>
wrapper
.
findComponent
(
FormStatus
);
function
createMockApolloProvider
(
requestHandlers
)
{
function
createMockApolloProvider
(
requestHandlers
)
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
return
createMockApollo
(
requestHandlers
);
return
createMockApollo
(
requestHandlers
);
}
}
function
createComponent
(
requestHandlers
=
[])
{
function
createComponent
(
requestHandlers
=
[])
{
return
shallowMount
(
CreateForm
,
{
return
shallowMount
(
CreateForm
,
{
localVue
,
apolloProvider
:
createMockApolloProvider
(
requestHandlers
),
apolloProvider
:
createMockApolloProvider
(
requestHandlers
),
propsData
,
propsData
,
});
});
...
...
ee/spec/frontend/groups/settings/compliance_frameworks/components/delete_modal_spec.js
View file @
54d8e51b
import
{
GlSprintf
,
GlModal
}
from
'
@gitlab/ui
'
;
import
{
GlSprintf
,
GlModal
}
from
'
@gitlab/ui
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
DeleteModal
from
'
ee/groups/settings/compliance_frameworks/components/delete_modal.vue
'
;
import
DeleteModal
from
'
ee/groups/settings/compliance_frameworks/components/delete_modal.vue
'
;
...
@@ -15,8 +16,7 @@ import {
...
@@ -15,8 +16,7 @@ import {
frameworkFoundResponse
,
frameworkFoundResponse
,
}
from
'
../mock_data
'
;
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
DeleteModal
'
,
()
=>
{
describe
(
'
DeleteModal
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -31,7 +31,7 @@ describe('DeleteModal', () => {
...
@@ -31,7 +31,7 @@ describe('DeleteModal', () => {
const
clickDeleteFramework
=
()
=>
findModal
().
vm
.
$emit
(
'
primary
'
);
const
clickDeleteFramework
=
()
=>
findModal
().
vm
.
$emit
(
'
primary
'
);
function
createMockApolloProvider
(
resolverMock
)
{
function
createMockApolloProvider
(
resolverMock
)
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
requestHandlers
=
[
const
requestHandlers
=
[
[
getComplianceFrameworkQuery
,
fetchSuccess
],
[
getComplianceFrameworkQuery
,
fetchSuccess
],
...
@@ -43,7 +43,6 @@ describe('DeleteModal', () => {
...
@@ -43,7 +43,6 @@ describe('DeleteModal', () => {
const
createComponent
=
(
resolverMock
)
=>
{
const
createComponent
=
(
resolverMock
)
=>
{
wrapper
=
shallowMount
(
DeleteModal
,
{
wrapper
=
shallowMount
(
DeleteModal
,
{
localVue
,
apolloProvider
:
createMockApolloProvider
(
resolverMock
),
apolloProvider
:
createMockApolloProvider
(
resolverMock
),
propsData
:
{
propsData
:
{
name
:
frameworkFoundResponse
.
name
,
name
:
frameworkFoundResponse
.
name
,
...
...
ee/spec/frontend/groups/settings/compliance_frameworks/components/edit_form_spec.js
View file @
54d8e51b
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
EditForm
from
'
ee/groups/settings/compliance_frameworks/components/edit_form.vue
'
;
import
EditForm
from
'
ee/groups/settings/compliance_frameworks/components/edit_form.vue
'
;
...
@@ -20,8 +21,7 @@ import {
...
@@ -20,8 +21,7 @@ import {
errorUpdateResponse
,
errorUpdateResponse
,
}
from
'
../mock_data
'
;
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
jest
.
mock
(
'
~/lib/utils/url_utility
'
);
jest
.
mock
(
'
~/lib/utils/url_utility
'
);
...
@@ -51,14 +51,13 @@ describe('EditForm', () => {
...
@@ -51,14 +51,13 @@ describe('EditForm', () => {
const
findFormStatus
=
()
=>
wrapper
.
findComponent
(
FormStatus
);
const
findFormStatus
=
()
=>
wrapper
.
findComponent
(
FormStatus
);
function
createMockApolloProvider
(
requestHandlers
)
{
function
createMockApolloProvider
(
requestHandlers
)
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
return
createMockApollo
(
requestHandlers
);
return
createMockApollo
(
requestHandlers
);
}
}
function
createComponent
(
requestHandlers
=
[])
{
function
createComponent
(
requestHandlers
=
[])
{
return
shallowMount
(
EditForm
,
{
return
shallowMount
(
EditForm
,
{
localVue
,
apolloProvider
:
createMockApolloProvider
(
requestHandlers
),
apolloProvider
:
createMockApolloProvider
(
requestHandlers
),
propsData
,
propsData
,
});
});
...
...
ee/spec/frontend/groups/settings/compliance_frameworks/components/list_spec.js
View file @
54d8e51b
import
{
GlAlert
,
GlButton
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
GlButton
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
DeleteModal
from
'
ee/groups/settings/compliance_frameworks/components/delete_modal.vue
'
;
import
DeleteModal
from
'
ee/groups/settings/compliance_frameworks/components/delete_modal.vue
'
;
...
@@ -14,8 +15,7 @@ import createMockApollo from 'helpers/mock_apollo_helper';
...
@@ -14,8 +15,7 @@ import createMockApollo from 'helpers/mock_apollo_helper';
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
validFetchResponse
,
emptyFetchResponse
}
from
'
../mock_data
'
;
import
{
validFetchResponse
,
emptyFetchResponse
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
List
'
,
()
=>
{
describe
(
'
List
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -34,7 +34,7 @@ describe('List', () => {
...
@@ -34,7 +34,7 @@ describe('List', () => {
const
findListItems
=
()
=>
wrapper
.
findAllComponents
(
ListItem
);
const
findListItems
=
()
=>
wrapper
.
findAllComponents
(
ListItem
);
function
createMockApolloProvider
(
resolverMock
)
{
function
createMockApolloProvider
(
resolverMock
)
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
requestHandlers
=
[[
getComplianceFrameworkQuery
,
resolverMock
]];
const
requestHandlers
=
[[
getComplianceFrameworkQuery
,
resolverMock
]];
...
@@ -43,7 +43,6 @@ describe('List', () => {
...
@@ -43,7 +43,6 @@ describe('List', () => {
function
createComponentWithApollo
(
resolverMock
,
props
=
{})
{
function
createComponentWithApollo
(
resolverMock
,
props
=
{})
{
return
shallowMount
(
List
,
{
return
shallowMount
(
List
,
{
localVue
,
apolloProvider
:
createMockApolloProvider
(
resolverMock
),
apolloProvider
:
createMockApolloProvider
(
resolverMock
),
propsData
:
{
propsData
:
{
addFrameworkPath
:
'
group/framework/new
'
,
addFrameworkPath
:
'
group/framework/new
'
,
...
...
ee/spec/frontend/hand_raise_leads/components/hand_raise_lead_button_spec.js
View file @
54d8e51b
import
{
GlButton
,
GlModal
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlModal
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
sprintf
}
from
'
~/locale
'
;
import
{
sprintf
}
from
'
~/locale
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
...
@@ -16,8 +16,7 @@ import {
...
@@ -16,8 +16,7 @@ import {
import
*
as
SubscriptionsApi
from
'
ee/api/subscriptions_api
'
;
import
*
as
SubscriptionsApi
from
'
ee/api/subscriptions_api
'
;
import
{
formData
,
states
,
countries
}
from
'
./mock_data
'
;
import
{
formData
,
states
,
countries
}
from
'
./mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
HandRaiseLeadButton
'
,
()
=>
{
describe
(
'
HandRaiseLeadButton
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -38,7 +37,6 @@ describe('HandRaiseLeadButton', () => {
...
@@ -38,7 +37,6 @@ describe('HandRaiseLeadButton', () => {
fakeApollo
=
createMockApollo
([],
mockResolvers
);
fakeApollo
=
createMockApollo
([],
mockResolvers
);
return
shallowMountExtended
(
HandRaiseLeadButton
,
{
return
shallowMountExtended
(
HandRaiseLeadButton
,
{
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
provide
:
{
provide
:
{
user
:
{
user
:
{
...
...
ee/spec/frontend/iterations/components/iteration_cadence_list_item_spec.js
View file @
54d8e51b
import
{
GlDropdown
,
GlInfiniteScroll
,
GlModal
,
GlSkeletonLoader
}
from
'
@gitlab/ui
'
;
import
{
GlDropdown
,
GlInfiniteScroll
,
GlModal
,
GlSkeletonLoader
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
RouterLinkStub
}
from
'
@vue/test-utils
'
;
import
{
RouterLinkStub
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
IterationCadenceListItem
from
'
ee/iterations/components/iteration_cadence_list_item.vue
'
;
import
IterationCadenceListItem
from
'
ee/iterations/components/iteration_cadence_list_item.vue
'
;
import
TimeboxStatusBadge
from
'
ee/iterations/components/timebox_status_badge.vue
'
;
import
TimeboxStatusBadge
from
'
ee/iterations/components/timebox_status_badge.vue
'
;
...
@@ -18,10 +19,8 @@ const $router = {
...
@@ -18,10 +19,8 @@ const $router = {
push
,
push
,
};
};
const
localVue
=
createLocalVue
();
function
createMockApolloProvider
(
requestHandlers
)
{
function
createMockApolloProvider
(
requestHandlers
)
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
return
createMockApollo
(
requestHandlers
);
return
createMockApollo
(
requestHandlers
);
}
}
...
@@ -99,7 +98,6 @@ describe('Iteration cadence list item', () => {
...
@@ -99,7 +98,6 @@ describe('Iteration cadence list item', () => {
apolloProvider
=
createMockApolloProvider
([[
query
,
resolverMock
]]);
apolloProvider
=
createMockApolloProvider
([[
query
,
resolverMock
]]);
wrapper
=
mount
(
IterationCadenceListItem
,
{
wrapper
=
mount
(
IterationCadenceListItem
,
{
localVue
,
apolloProvider
,
apolloProvider
,
mocks
:
{
mocks
:
{
$router
:
{
$router
:
{
...
...
ee/spec/frontend/iterations/components/iteration_cadences_list_spec.js
View file @
54d8e51b
import
{
GlKeysetPagination
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlKeysetPagination
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
IterationCadenceListItem
from
'
ee/iterations/components/iteration_cadence_list_item.vue
'
;
import
IterationCadenceListItem
from
'
ee/iterations/components/iteration_cadence_list_item.vue
'
;
import
IterationCadencesList
from
'
ee/iterations/components/iteration_cadences_list.vue
'
;
import
IterationCadencesList
from
'
ee/iterations/components/iteration_cadences_list.vue
'
;
...
@@ -14,13 +13,11 @@ import { TEST_HOST } from 'helpers/test_constants';
...
@@ -14,13 +13,11 @@ import { TEST_HOST } from 'helpers/test_constants';
import
{
mountExtended
as
mount
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
mountExtended
as
mount
}
from
'
helpers/vue_test_utils_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
const
localVue
=
createLocalVue
();
const
baseUrl
=
'
/cadences/
'
;
const
baseUrl
=
'
/cadences/
'
;
const
router
=
createRouter
(
baseUrl
);
const
router
=
createRouter
(
baseUrl
);
function
createMockApolloProvider
(
requestHandlers
)
{
function
createMockApolloProvider
(
requestHandlers
)
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
return
createMockApollo
(
requestHandlers
);
return
createMockApollo
(
requestHandlers
);
}
}
...
@@ -104,7 +101,6 @@ describe('Iteration cadences list', () => {
...
@@ -104,7 +101,6 @@ describe('Iteration cadences list', () => {
]);
]);
wrapper
=
mount
(
IterationCadencesList
,
{
wrapper
=
mount
(
IterationCadencesList
,
{
localVue
,
apolloProvider
,
apolloProvider
,
router
,
router
,
provide
:
{
provide
:
{
...
...
ee/spec/frontend/iterations/components/iteration_report_spec.js
View file @
54d8e51b
import
{
GlDropdown
,
GlEmptyState
,
GlLoadingIcon
,
GlTab
,
GlTabs
}
from
'
@gitlab/ui
'
;
import
{
GlDropdown
,
GlEmptyState
,
GlLoadingIcon
,
GlTab
,
GlTabs
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
IterationReport
from
'
ee/iterations/components/iteration_report.vue
'
;
import
IterationReport
from
'
ee/iterations/components/iteration_report.vue
'
;
import
IterationReportTabs
from
'
ee/iterations/components/iteration_report_tabs.vue
'
;
import
IterationReportTabs
from
'
ee/iterations/components/iteration_report_tabs.vue
'
;
...
@@ -12,7 +13,6 @@ import waitForPromises from 'helpers/wait_for_promises';
...
@@ -12,7 +13,6 @@ import waitForPromises from 'helpers/wait_for_promises';
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
getIdFromGraphQLId
}
from
'
~/graphql_shared/utils
'
;
import
{
mockIterationNode
,
mockGroupIterations
,
mockProjectIterations
}
from
'
../mock_data
'
;
import
{
mockIterationNode
,
mockGroupIterations
,
mockProjectIterations
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
const
$router
=
{
const
$router
=
{
push
:
jest
.
fn
(),
push
:
jest
.
fn
(),
currentRoute
:
{
currentRoute
:
{
...
@@ -50,14 +50,13 @@ describe('Iterations report', () => {
...
@@ -50,14 +50,13 @@ describe('Iterations report', () => {
deleteMutationResponse
=
{
data
:
{
iterationDelete
:
{
errors
:
[]
}
}
},
deleteMutationResponse
=
{
data
:
{
iterationDelete
:
{
errors
:
[]
}
}
},
deleteMutationMock
=
jest
.
fn
().
mockResolvedValue
(
deleteMutationResponse
),
deleteMutationMock
=
jest
.
fn
().
mockResolvedValue
(
deleteMutationResponse
),
}
=
{})
=>
{
}
=
{})
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
mockApollo
=
createMockApollo
([
mockApollo
=
createMockApollo
([
[
query
,
iterationQueryHandler
],
[
query
,
iterationQueryHandler
],
[
deleteIteration
,
deleteMutationMock
],
[
deleteIteration
,
deleteMutationMock
],
]);
]);
wrapper
=
shallowMount
(
IterationReport
,
{
wrapper
=
shallowMount
(
IterationReport
,
{
localVue
,
apolloProvider
:
mockApollo
,
apolloProvider
:
mockApollo
,
propsData
:
props
,
propsData
:
props
,
provide
:
{
provide
:
{
...
...
ee/spec/frontend/on_demand_scans/components/tabs/base_tab_spec.js
View file @
54d8e51b
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
{
GlTab
,
GlTable
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
GlTab
,
GlTable
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
cloneDeep
,
merge
}
from
'
lodash
'
;
import
{
cloneDeep
,
merge
}
from
'
lodash
'
;
import
allPipelinesWithPipelinesMock
from
'
test_fixtures/graphql/on_demand_scans/graphql/on_demand_scans.query.graphql.with_pipelines.json
'
;
import
allPipelinesWithPipelinesMock
from
'
test_fixtures/graphql/on_demand_scans/graphql/on_demand_scans.query.graphql.with_pipelines.json
'
;
...
@@ -23,8 +22,7 @@ import { PROJECT_ON_DEMAND_SCAN_COUNTS_ETAG_MOCK } from '../../mocks';
...
@@ -23,8 +22,7 @@ import { PROJECT_ON_DEMAND_SCAN_COUNTS_ETAG_MOCK } from '../../mocks';
jest
.
mock
(
'
~/lib/utils/common_utils
'
);
jest
.
mock
(
'
~/lib/utils/common_utils
'
);
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
[
firstPipeline
]
=
allPipelinesWithPipelinesMock
.
data
.
project
.
pipelines
.
nodes
;
const
[
firstPipeline
]
=
allPipelinesWithPipelinesMock
.
data
.
project
.
pipelines
.
nodes
;
...
@@ -76,7 +74,6 @@ describe('BaseTab', () => {
...
@@ -76,7 +74,6 @@ describe('BaseTab', () => {
BaseTab
,
BaseTab
,
merge
(
merge
(
{
{
localVue
,
apolloProvider
:
createMockApolloProvider
(),
apolloProvider
:
createMockApolloProvider
(),
router
,
router
,
propsData
:
{
propsData
:
{
...
...
ee/spec/frontend/oncall_schedule/oncall_schedule_spec.js
View file @
54d8e51b
import
{
GlButton
,
GlCard
,
GlIcon
,
GlCollapse
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlCard
,
GlIcon
,
GlCollapse
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
mockTimezones
from
'
test_fixtures/timezones/full.json
'
;
import
mockTimezones
from
'
test_fixtures/timezones/full.json
'
;
import
OnCallSchedule
,
{
i18n
}
from
'
ee/oncall_schedules/components/oncall_schedule.vue
'
;
import
OnCallSchedule
,
{
i18n
}
from
'
ee/oncall_schedules/components/oncall_schedule.vue
'
;
...
@@ -16,8 +16,7 @@ import waitForPromises from 'helpers/wait_for_promises';
...
@@ -16,8 +16,7 @@ import waitForPromises from 'helpers/wait_for_promises';
import
*
as
dateTimeUtility
from
'
~/lib/utils/datetime/date_calculation_utility
'
;
import
*
as
dateTimeUtility
from
'
~/lib/utils/datetime/date_calculation_utility
'
;
import
{
getOncallSchedulesQueryResponse
}
from
'
./mocks/apollo_mock
'
;
import
{
getOncallSchedulesQueryResponse
}
from
'
./mocks/apollo_mock
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
On-call schedule
'
,
()
=>
{
describe
(
'
On-call schedule
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -56,7 +55,6 @@ describe('On-call schedule', () => {
...
@@ -56,7 +55,6 @@ describe('On-call schedule', () => {
]);
]);
wrapper
=
shallowMountExtended
(
OnCallSchedule
,
{
wrapper
=
shallowMountExtended
(
OnCallSchedule
,
{
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
propsData
:
{
propsData
:
{
schedule
,
schedule
,
...
...
ee/spec/frontend/oncall_schedule/oncall_schedule_wrapper_spec.js
View file @
54d8e51b
import
{
GlEmptyState
,
GlLoadingIcon
,
GlSprintf
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlEmptyState
,
GlLoadingIcon
,
GlSprintf
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
AddScheduleModal
from
'
ee/oncall_schedules/components/add_edit_schedule_modal.vue
'
;
import
AddScheduleModal
from
'
ee/oncall_schedules/components/add_edit_schedule_modal.vue
'
;
import
OnCallSchedule
from
'
ee/oncall_schedules/components/oncall_schedule.vue
'
;
import
OnCallSchedule
from
'
ee/oncall_schedules/components/oncall_schedule.vue
'
;
...
@@ -14,8 +15,6 @@ import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
...
@@ -14,8 +15,6 @@ import { createMockDirective, getBinding } from 'helpers/vue_mock_directive';
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
preExistingSchedule
,
newlyCreatedSchedule
}
from
'
./mocks/apollo_mock
'
;
import
{
preExistingSchedule
,
newlyCreatedSchedule
}
from
'
./mocks/apollo_mock
'
;
const
localVue
=
createLocalVue
();
describe
(
'
On-call schedule wrapper
'
,
()
=>
{
describe
(
'
On-call schedule wrapper
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
const
emptyOncallSchedulesSvgPath
=
'
illustration/path.svg
'
;
const
emptyOncallSchedulesSvgPath
=
'
illustration/path.svg
'
;
...
@@ -60,10 +59,9 @@ describe('On-call schedule wrapper', () => {
...
@@ -60,10 +59,9 @@ describe('On-call schedule wrapper', () => {
const
fakeApollo
=
createMockApollo
([
const
fakeApollo
=
createMockApollo
([
[
getOncallSchedulesWithRotationsQuery
,
getOncallSchedulesQuerySpy
],
[
getOncallSchedulesWithRotationsQuery
,
getOncallSchedulesQuerySpy
],
]);
]);
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
wrapper
=
shallowMount
(
OnCallScheduleWrapper
,
{
wrapper
=
shallowMount
(
OnCallScheduleWrapper
,
{
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
data
()
{
data
()
{
return
{
return
{
...
...
ee/spec/frontend/pipeline_editor/components/header/pipeline_editor_mini_graph_spec.js
View file @
54d8e51b
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
@@ -6,8 +7,7 @@ import PipelineEditorMiniGraph from '~/pipeline_editor/components/header/pipelin
...
@@ -6,8 +7,7 @@ import PipelineEditorMiniGraph from '~/pipeline_editor/components/header/pipelin
import
getLinkedPipelinesQuery
from
'
~/projects/commit_box/info/graphql/queries/get_linked_pipelines.query.graphql
'
;
import
getLinkedPipelinesQuery
from
'
~/projects/commit_box/info/graphql/queries/get_linked_pipelines.query.graphql
'
;
import
{
mockLinkedPipelines
,
mockProjectFullPath
,
mockProjectPipeline
}
from
'
../../mock_data
'
;
import
{
mockLinkedPipelines
,
mockProjectFullPath
,
mockProjectPipeline
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Pipeline Status
'
,
()
=>
{
describe
(
'
Pipeline Status
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -34,7 +34,6 @@ describe('Pipeline Status', () => {
...
@@ -34,7 +34,6 @@ describe('Pipeline Status', () => {
createComponent
({
createComponent
({
hasStages
,
hasStages
,
options
:
{
options
:
{
localVue
,
apolloProvider
:
mockApollo
,
apolloProvider
:
mockApollo
,
},
},
});
});
...
...
ee/spec/frontend/project_quality_summary/app_spec.js
View file @
54d8e51b
import
{
GlSkeletonLoader
}
from
'
@gitlab/ui
'
;
import
{
GlSkeletonLoader
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
mockProjectQualityResponse
from
'
test_fixtures/graphql/project_quality_summary/graphql/queries/get_project_quality.query.graphql.json
'
;
import
mockProjectQualityResponse
from
'
test_fixtures/graphql/project_quality_summary/graphql/queries/get_project_quality.query.graphql.json
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
@@ -12,8 +12,7 @@ import getProjectQuality from 'ee/project_quality_summary/graphql/queries/get_pr
...
@@ -12,8 +12,7 @@ import getProjectQuality from 'ee/project_quality_summary/graphql/queries/get_pr
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Project quality summary app component
'
,
()
=>
{
describe
(
'
Project quality summary app component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -32,7 +31,6 @@ describe('Project quality summary app component', () => {
...
@@ -32,7 +31,6 @@ describe('Project quality summary app component', () => {
const
apolloProvider
=
createMockApollo
([[
getProjectQuality
,
mockReturnValue
]]);
const
apolloProvider
=
createMockApollo
([[
getProjectQuality
,
mockReturnValue
]]);
wrapper
=
mountExtended
(
ProjectQualitySummary
,
{
wrapper
=
mountExtended
(
ProjectQualitySummary
,
{
localVue
,
apolloProvider
,
apolloProvider
,
provide
:
{
provide
:
{
projectPath
:
'
project-path
'
,
projectPath
:
'
project-path
'
,
...
...
ee/spec/frontend/repository/components/code_owners_spec.js
View file @
54d8e51b
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -11,10 +12,8 @@ import { codeOwnerMock, codeOwnersDataMock, refMock } from '../mock_data';
...
@@ -11,10 +12,8 @@ import { codeOwnerMock, codeOwnersDataMock, refMock } from '../mock_data';
let
wrapper
;
let
wrapper
;
let
mockResolver
;
let
mockResolver
;
const
localVue
=
createLocalVue
();
const
createComponent
=
async
(
codeOwners
=
[
codeOwnerMock
])
=>
{
const
createComponent
=
async
(
codeOwners
=
[
codeOwnerMock
])
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
project
=
{
const
project
=
{
...
codeOwnersDataMock
,
...
codeOwnersDataMock
,
...
@@ -29,7 +28,6 @@ const createComponent = async (codeOwners = [codeOwnerMock]) => {
...
@@ -29,7 +28,6 @@ const createComponent = async (codeOwners = [codeOwnerMock]) => {
wrapper
=
extendedWrapper
(
wrapper
=
extendedWrapper
(
shallowMount
(
CodeOwners
,
{
shallowMount
(
CodeOwners
,
{
localVue
,
apolloProvider
:
createMockApollo
([[
codeOwnersInfoQuery
,
mockResolver
]]),
apolloProvider
:
createMockApollo
([[
codeOwnersInfoQuery
,
mockResolver
]]),
propsData
:
{
projectPath
:
'
some/project
'
,
filePath
:
'
some/file
'
},
propsData
:
{
projectPath
:
'
some/project
'
,
filePath
:
'
some/file
'
},
mixins
:
[{
data
:
()
=>
({
ref
:
refMock
})
}],
mixins
:
[{
data
:
()
=>
({
ref
:
refMock
})
}],
...
...
ee/spec/frontend/repository/components/lock_button_spec.js
View file @
54d8e51b
import
{
GlButton
,
GlModal
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlModal
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
LockButton
from
'
ee_component/repository/components/lock_button.vue
'
;
import
LockButton
from
'
ee_component/repository/components/lock_button.vue
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
@@ -15,17 +16,15 @@ const DEFAULT_PROPS = {
...
@@ -15,17 +16,15 @@ const DEFAULT_PROPS = {
};
};
describe
(
'
LockButton component
'
,
()
=>
{
describe
(
'
LockButton component
'
,
()
=>
{
const
localVue
=
createLocalVue
();
let
wrapper
;
let
wrapper
;
const
createMockApolloProvider
=
(
resolverMock
)
=>
{
const
createMockApolloProvider
=
(
resolverMock
)
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
return
createMockApollo
([[
lockPathMutation
,
resolverMock
]]);
return
createMockApollo
([[
lockPathMutation
,
resolverMock
]]);
};
};
const
createComponent
=
(
props
=
{},
lockMutation
=
jest
.
fn
())
=>
{
const
createComponent
=
(
props
=
{},
lockMutation
=
jest
.
fn
())
=>
{
wrapper
=
shallowMount
(
LockButton
,
{
wrapper
=
shallowMount
(
LockButton
,
{
localVue
,
apolloProvider
:
createMockApolloProvider
(
lockMutation
),
apolloProvider
:
createMockApolloProvider
(
lockMutation
),
propsData
:
{
propsData
:
{
...
DEFAULT_PROPS
,
...
DEFAULT_PROPS
,
...
...
ee/spec/frontend/runner/components/runner_update_form_spec.js
View file @
54d8e51b
import
Vue
from
'
vue
'
;
import
{
GlForm
}
from
'
@gitlab/ui
'
;
import
{
GlForm
}
from
'
@gitlab/ui
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
mountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
runnerData
}
from
'
jest/runner/mock_data
'
;
import
{
runnerData
}
from
'
jest/runner/mock_data
'
;
import
{
createAlert
,
VARIANT_SUCCESS
}
from
'
~/flash
'
;
import
{
createAlert
,
VARIANT_SUCCESS
}
from
'
~/flash
'
;
...
@@ -34,13 +35,15 @@ describe('RunnerUpdateForm', () => {
...
@@ -34,13 +35,15 @@ describe('RunnerUpdateForm', () => {
const
submitFormAndWait
=
()
=>
submitForm
().
then
(
waitForPromises
);
const
submitFormAndWait
=
()
=>
submitForm
().
then
(
waitForPromises
);
const
createComponent
=
({
props
}
=
{})
=>
{
const
createComponent
=
({
props
}
=
{})
=>
{
wrapper
=
mountExtended
(
RunnerUpdateForm
,
{
wrapper
=
extendedWrapper
(
mount
(
RunnerUpdateForm
,
{
propsData
:
{
propsData
:
{
runner
:
mockRunner
,
runner
:
mockRunner
,
...
props
,
...
props
,
},
},
apolloProvider
:
createMockApollo
([[
runnerUpdateMutation
,
runnerUpdateHandler
]]),
apolloProvider
:
createMockApollo
([[
runnerUpdateMutation
,
runnerUpdateHandler
]]),
});
}),
);
};
};
const
expectToHaveSubmittedRunnerContaining
=
(
submittedRunner
)
=>
{
const
expectToHaveSubmittedRunnerContaining
=
(
submittedRunner
)
=>
{
...
...
ee/spec/frontend/security_configuration/dast_profiles/components/base_dast_profile_form_spec.js
View file @
54d8e51b
import
{
GlAlert
,
GlForm
,
GlModal
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
GlForm
,
GlModal
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
merge
from
'
lodash/merge
'
;
import
merge
from
'
lodash/merge
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
BaseDastProfileForm
from
'
ee/security_configuration/dast_profiles/components/base_dast_profile_form.vue
'
;
import
BaseDastProfileForm
from
'
ee/security_configuration/dast_profiles/components/base_dast_profile_form.vue
'
;
...
@@ -9,8 +9,7 @@ import createMockApollo from 'helpers/mock_apollo_helper';
...
@@ -9,8 +9,7 @@ import createMockApollo from 'helpers/mock_apollo_helper';
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
mutationVariables
=
{
const
mutationVariables
=
{
foo
:
'
bar
'
,
foo
:
'
bar
'
,
...
@@ -52,7 +51,6 @@ describe('BaseDastProfileForm', () => {
...
@@ -52,7 +51,6 @@ describe('BaseDastProfileForm', () => {
},
},
options
,
options
,
{
{
localVue
,
apolloProvider
,
apolloProvider
,
},
},
);
);
...
...
ee/spec/frontend/security_configuration/dast_profiles/components/dast_failed_site_validations_spec.js
View file @
54d8e51b
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
within
}
from
'
@testing-library/dom
'
;
import
{
within
}
from
'
@testing-library/dom
'
;
import
{
mount
,
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
{
merge
}
from
'
lodash
'
;
import
{
merge
}
from
'
lodash
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
DastFailedSiteValidations
from
'
ee/security_configuration/dast_profiles/components/dast_failed_site_validations.vue
'
;
import
DastFailedSiteValidations
from
'
ee/security_configuration/dast_profiles/components/dast_failed_site_validations.vue
'
;
...
@@ -21,14 +22,12 @@ const GlModal = {
...
@@ -21,14 +22,12 @@ const GlModal = {
},
},
};
};
const
localVue
=
createLocalVue
();
describe
(
'
EE - DastFailedSiteValidations
'
,
()
=>
{
describe
(
'
EE - DastFailedSiteValidations
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
requestHandlers
;
let
requestHandlers
;
const
createMockApolloProvider
=
(
handlers
)
=>
{
const
createMockApolloProvider
=
(
handlers
)
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
requestHandlers
=
handlers
;
requestHandlers
=
handlers
;
return
createApolloProvider
([
return
createApolloProvider
([
[
dastFailedSiteValidationsQuery
,
requestHandlers
.
dastFailedSiteValidations
],
[
dastFailedSiteValidationsQuery
,
requestHandlers
.
dastFailedSiteValidations
],
...
@@ -47,7 +46,6 @@ describe('EE - DastFailedSiteValidations', () => {
...
@@ -47,7 +46,6 @@ describe('EE - DastFailedSiteValidations', () => {
merge
(
merge
(
{
{
propsData
:
defaultProps
,
propsData
:
defaultProps
,
localVue
,
apolloProvider
:
createMockApolloProvider
(
handlers
),
apolloProvider
:
createMockApolloProvider
(
handlers
),
stubs
:
{
stubs
:
{
GlModal
,
GlModal
,
...
...
ee/spec/frontend/security_configuration/dast_profiles/components/dast_site_profiles_list_spec.js
View file @
54d8e51b
import
{
within
,
fireEvent
}
from
'
@testing-library/dom
'
;
import
{
within
,
fireEvent
}
from
'
@testing-library/dom
'
;
import
{
mount
,
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
{
merge
}
from
'
lodash
'
;
import
{
merge
}
from
'
lodash
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
ProfilesList
from
'
ee/security_configuration/dast_profiles/components/dast_profiles_list.vue
'
;
import
ProfilesList
from
'
ee/security_configuration/dast_profiles/components/dast_profiles_list.vue
'
;
...
@@ -20,7 +21,6 @@ jest.mock('ee/security_configuration/dast_profiles/graphql/cache_utils', () => (
...
@@ -20,7 +21,6 @@ jest.mock('ee/security_configuration/dast_profiles/graphql/cache_utils', () => (
}));
}));
describe
(
'
EE - DastSiteProfileList
'
,
()
=>
{
describe
(
'
EE - DastSiteProfileList
'
,
()
=>
{
let
localVue
;
let
wrapper
;
let
wrapper
;
let
requestHandlers
;
let
requestHandlers
;
let
apolloProvider
;
let
apolloProvider
;
...
@@ -39,13 +39,12 @@ describe('EE - DastSiteProfileList', () => {
...
@@ -39,13 +39,12 @@ describe('EE - DastSiteProfileList', () => {
};
};
const
createMockApolloProvider
=
(
handlers
)
=>
{
const
createMockApolloProvider
=
(
handlers
)
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
requestHandlers
=
handlers
;
requestHandlers
=
handlers
;
return
createApolloProvider
([[
dastSiteValidationsQuery
,
requestHandlers
.
dastSiteValidations
]]);
return
createApolloProvider
([[
dastSiteValidationsQuery
,
requestHandlers
.
dastSiteValidations
]]);
};
};
const
wrapperFactory
=
(
mountFn
=
shallowMount
)
=>
(
options
=
{},
handlers
)
=>
{
const
wrapperFactory
=
(
mountFn
=
shallowMount
)
=>
(
options
=
{},
handlers
)
=>
{
localVue
=
createLocalVue
();
apolloProvider
=
handlers
&&
createMockApolloProvider
(
handlers
);
apolloProvider
=
handlers
&&
createMockApolloProvider
(
handlers
);
wrapper
=
mountFn
(
wrapper
=
mountFn
(
Component
,
Component
,
...
@@ -53,7 +52,7 @@ describe('EE - DastSiteProfileList', () => {
...
@@ -53,7 +52,7 @@ describe('EE - DastSiteProfileList', () => {
{
{
propsData
:
defaultProps
,
propsData
:
defaultProps
,
},
},
{
...
options
,
localVue
,
apolloProvider
},
{
...
options
,
apolloProvider
},
),
),
);
);
};
};
...
...
ee/spec/frontend/security_configuration/dast_profiles/dast_site_validation/components/dast_site_validation_modal_spec.js
View file @
54d8e51b
import
{
GlAlert
,
GlFormGroup
,
GlModal
,
GlSkeletonLoader
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
GlFormGroup
,
GlModal
,
GlSkeletonLoader
}
from
'
@gitlab/ui
'
;
import
{
within
}
from
'
@testing-library/dom
'
;
import
{
within
}
from
'
@testing-library/dom
'
;
import
{
createLocalVue
,
mount
,
shallowMount
,
createWrapper
}
from
'
@vue/test-utils
'
;
import
{
mount
,
shallowMount
,
createWrapper
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
merge
from
'
lodash/merge
'
;
import
merge
from
'
lodash/merge
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
DastSiteValidationModal
from
'
ee/security_configuration/dast_site_validation/components/dast_site_validation_modal.vue
'
;
import
DastSiteValidationModal
from
'
ee/security_configuration/dast_site_validation/components/dast_site_validation_modal.vue
'
;
...
@@ -14,8 +15,7 @@ import * as responses from '../mock_data/apollo_mock';
...
@@ -14,8 +15,7 @@ import * as responses from '../mock_data/apollo_mock';
jest
.
mock
(
'
~/lib/utils/downloader
'
);
jest
.
mock
(
'
~/lib/utils/downloader
'
);
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
fullPath
=
'
group/project
'
;
const
fullPath
=
'
group/project
'
;
const
targetUrl
=
'
https://example.com/
'
;
const
targetUrl
=
'
https://example.com/
'
;
...
@@ -60,7 +60,6 @@ describe('DastSiteValidationModal', () => {
...
@@ -60,7 +60,6 @@ describe('DastSiteValidationModal', () => {
},
},
mountOptions
,
mountOptions
,
{
{
localVue
,
apolloProvider
:
createApolloProvider
([
apolloProvider
:
createApolloProvider
([
[
dastSiteTokenCreateMutation
,
requestHandlers
.
dastSiteTokenCreate
],
[
dastSiteTokenCreateMutation
,
requestHandlers
.
dastSiteTokenCreate
],
[
dastSiteValidationCreateMutation
,
requestHandlers
.
dastSiteValidationCreate
],
[
dastSiteValidationCreateMutation
,
requestHandlers
.
dastSiteValidationCreate
],
...
...
ee/spec/frontend/security_dashboard/components/instance/project_list_spec.js
View file @
54d8e51b
import
{
GlBadge
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlBadge
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
ProjectList
from
'
ee/security_dashboard/components/instance/project_list.vue
'
;
import
ProjectList
from
'
ee/security_dashboard/components/instance/project_list.vue
'
;
import
projectsQuery
from
'
ee/security_dashboard/graphql/queries/instance_projects.query.graphql
'
;
import
projectsQuery
from
'
ee/security_dashboard/graphql/queries/instance_projects.query.graphql
'
;
...
@@ -8,8 +9,7 @@ import waitForPromises from 'helpers/wait_for_promises';
...
@@ -8,8 +9,7 @@ import waitForPromises from 'helpers/wait_for_promises';
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
ProjectAvatar
from
'
~/vue_shared/components/deprecated_project_avatar/default.vue
'
;
import
ProjectAvatar
from
'
~/vue_shared/components/deprecated_project_avatar/default.vue
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
generateMockProjects
=
(
count
)
=>
{
const
generateMockProjects
=
(
count
)
=>
{
const
projects
=
[];
const
projects
=
[];
...
@@ -43,7 +43,6 @@ describe('Project List component', () => {
...
@@ -43,7 +43,6 @@ describe('Project List component', () => {
wrapper
=
extendedWrapper
(
wrapper
=
extendedWrapper
(
shallowMount
(
ProjectList
,
{
shallowMount
(
ProjectList
,
{
localVue
,
apolloProvider
:
createMockApollo
([[
projectsQuery
,
jest
.
fn
().
mockResolvedValue
(
mockData
)]]),
apolloProvider
:
createMockApollo
([[
projectsQuery
,
jest
.
fn
().
mockResolvedValue
(
mockData
)]]),
}),
}),
);
);
...
...
ee/spec/frontend/security_dashboard/components/pipeline/pipeline_findings_spec.js
View file @
54d8e51b
import
{
GlAlert
,
GlIntersectionObserver
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
GlIntersectionObserver
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
PipelineFindings
from
'
ee/security_dashboard/components/pipeline/pipeline_findings.vue
'
;
import
PipelineFindings
from
'
ee/security_dashboard/components/pipeline/pipeline_findings.vue
'
;
import
FindingModal
from
'
ee/security_dashboard/components/pipeline/vulnerability_finding_modal.vue
'
;
import
FindingModal
from
'
ee/security_dashboard/components/pipeline/vulnerability_finding_modal.vue
'
;
...
@@ -18,14 +19,11 @@ describe('Pipeline findings', () => {
...
@@ -18,14 +19,11 @@ describe('Pipeline findings', () => {
};
};
const
createWrapper
=
({
props
=
{},
mocks
,
apolloProvider
}
=
{})
=>
{
const
createWrapper
=
({
props
=
{},
mocks
,
apolloProvider
}
=
{})
=>
{
const
localVue
=
createLocalVue
();
if
(
apolloProvider
)
{
if
(
apolloProvider
)
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
}
}
wrapper
=
shallowMount
(
PipelineFindings
,
{
wrapper
=
shallowMount
(
PipelineFindings
,
{
localVue
,
apolloProvider
,
apolloProvider
,
provide
:
{
provide
:
{
projectFullPath
:
'
gitlab/security-reports
'
,
projectFullPath
:
'
gitlab/security-reports
'
,
...
...
ee/spec/frontend/security_dashboard/components/pipeline/pipeline_security_dashboard_spec.js
View file @
54d8e51b
import
{
GlEmptyState
}
from
'
@gitlab/ui
'
;
import
{
GlEmptyState
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
@@ -17,8 +18,7 @@ import {
...
@@ -17,8 +18,7 @@ import {
pipelineSecurityReportSummaryEmpty
,
pipelineSecurityReportSummaryEmpty
,
}
from
'
./mock_data
'
;
}
from
'
./mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
Vuex
);
localVue
.
use
(
Vuex
);
const
dashboardDocumentation
=
'
/help/docs
'
;
const
dashboardDocumentation
=
'
/help/docs
'
;
const
emptyStateSvgPath
=
'
/svgs/empty/svg
'
;
const
emptyStateSvgPath
=
'
/svgs/empty/svg
'
;
...
@@ -62,7 +62,6 @@ describe('Pipeline Security Dashboard component', () => {
...
@@ -62,7 +62,6 @@ describe('Pipeline Security Dashboard component', () => {
jest
.
spyOn
(
store
,
'
dispatch
'
).
mockImplementation
();
jest
.
spyOn
(
store
,
'
dispatch
'
).
mockImplementation
();
wrapper
=
shallowMount
(
PipelineSecurityDashboard
,
{
wrapper
=
shallowMount
(
PipelineSecurityDashboard
,
{
localVue
,
apolloProvider
,
apolloProvider
,
store
,
store
,
provide
:
{
provide
:
{
...
@@ -85,7 +84,7 @@ describe('Pipeline Security Dashboard component', () => {
...
@@ -85,7 +84,7 @@ describe('Pipeline Security Dashboard component', () => {
};
};
const
factoryWithApollo
=
({
requestHandlers
})
=>
{
const
factoryWithApollo
=
({
requestHandlers
})
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
factory
({
apolloProvider
:
createMockApollo
(
requestHandlers
)
});
factory
({
apolloProvider
:
createMockApollo
(
requestHandlers
)
});
};
};
...
...
ee/spec/frontend/security_dashboard/components/project/project_security_dashboard_spec.js
View file @
54d8e51b
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLineChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
GlLineChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
ProjectSecurityDashboard
from
'
ee/security_dashboard/components/project/project_security_dashboard.vue
'
;
import
ProjectSecurityDashboard
from
'
ee/security_dashboard/components/project/project_security_dashboard.vue
'
;
import
ReportNotConfigured
from
'
ee/security_dashboard/components/shared/empty_states/report_not_configured_project.vue
'
;
import
ReportNotConfigured
from
'
ee/security_dashboard/components/shared/empty_states/report_not_configured_project.vue
'
;
...
@@ -14,8 +15,7 @@ import {
...
@@ -14,8 +15,7 @@ import {
mockProjectSecurityChartsWithoutData
,
mockProjectSecurityChartsWithoutData
,
}
from
'
../../mock_data
'
;
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
jest
.
mock
(
'
~/lib/utils/icon_utils
'
,
()
=>
({
jest
.
mock
(
'
~/lib/utils/icon_utils
'
,
()
=>
({
getSvgIconPathContent
:
jest
.
fn
().
mockResolvedValue
(
'
mockSvgPathContent
'
),
getSvgIconPathContent
:
jest
.
fn
().
mockResolvedValue
(
'
mockSvgPathContent
'
),
...
@@ -43,7 +43,6 @@ describe('Project Security Dashboard component', () => {
...
@@ -43,7 +43,6 @@ describe('Project Security Dashboard component', () => {
secureVulnerabilityTrainingEnabled
=
true
,
secureVulnerabilityTrainingEnabled
=
true
,
})
=>
{
})
=>
{
const
component
=
shallowMount
(
ProjectSecurityDashboard
,
{
const
component
=
shallowMount
(
ProjectSecurityDashboard
,
{
localVue
,
apolloProvider
:
createApolloProvider
([
apolloProvider
:
createApolloProvider
([
projectsHistoryQuery
,
projectsHistoryQuery
,
jest
.
fn
().
mockResolvedValue
(
query
),
jest
.
fn
().
mockResolvedValue
(
query
),
...
...
ee/spec/frontend/security_dashboard/components/project/project_vulnerability_report_spec.js
View file @
54d8e51b
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
Cookies
from
'
js-cookie
'
;
import
Cookies
from
'
js-cookie
'
;
import
VueRouter
from
'
vue-router
'
;
import
VueRouter
from
'
vue-router
'
;
...
@@ -18,9 +19,8 @@ import createMockApollo from 'helpers/mock_apollo_helper';
...
@@ -18,9 +19,8 @@ import createMockApollo from 'helpers/mock_apollo_helper';
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
SCANNER_NAMES_MAP
}
from
'
~/security_configuration/components/constants
'
;
import
{
SCANNER_NAMES_MAP
}
from
'
~/security_configuration/components/constants
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
Vue
.
use
(
VueRouter
);
localVue
.
use
(
VueRouter
);
const
router
=
new
VueRouter
();
const
router
=
new
VueRouter
();
describe
(
'
Project vulnerability report app component
'
,
()
=>
{
describe
(
'
Project vulnerability report app component
'
,
()
=>
{
...
@@ -45,7 +45,6 @@ describe('Project vulnerability report app component', () => {
...
@@ -45,7 +45,6 @@ describe('Project vulnerability report app component', () => {
secureVulnerabilityTraining
=
true
,
secureVulnerabilityTraining
=
true
,
}
=
{})
=>
{
}
=
{})
=>
{
wrapper
=
shallowMount
(
ProjectVulnerabilityReport
,
{
wrapper
=
shallowMount
(
ProjectVulnerabilityReport
,
{
localVue
,
router
,
router
,
apolloProvider
:
createMockApollo
([
apolloProvider
:
createMockApollo
([
[
securityScannersQuery
,
securityScannersHandler
(
securityScanners
)],
[
securityScannersQuery
,
securityScannersHandler
(
securityScanners
)],
...
...
ee/spec/frontend/security_dashboard/components/shared/project_security_status_chart_spec.js
View file @
54d8e51b
import
{
GlLink
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLink
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VulnerabilitySeverity
from
'
ee/security_dashboard/components/shared/project_security_status_chart.vue
'
;
import
VulnerabilitySeverity
from
'
ee/security_dashboard/components/shared/project_security_status_chart.vue
'
;
import
groupVulnerabilityGradesQuery
from
'
ee/security_dashboard/graphql/queries/group_vulnerability_grades.query.graphql
'
;
import
groupVulnerabilityGradesQuery
from
'
ee/security_dashboard/graphql/queries/group_vulnerability_grades.query.graphql
'
;
...
@@ -15,8 +16,7 @@ import {
...
@@ -15,8 +16,7 @@ import {
mockGroupVulnerabilityGrades
,
mockGroupVulnerabilityGrades
,
}
from
'
../../mock_data
'
;
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Vulnerability Severity component
'
,
()
=>
{
describe
(
'
Vulnerability Severity component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -31,7 +31,6 @@ describe('Vulnerability Severity component', () => {
...
@@ -31,7 +31,6 @@ describe('Vulnerability Severity component', () => {
const
createComponent
=
({
provide
,
query
,
mockData
}
=
{})
=>
{
const
createComponent
=
({
provide
,
query
,
mockData
}
=
{})
=>
{
return
shallowMount
(
VulnerabilitySeverity
,
{
return
shallowMount
(
VulnerabilitySeverity
,
{
localVue
,
apolloProvider
:
createMockApollo
([[
query
,
jest
.
fn
().
mockResolvedValue
(
mockData
)]]),
apolloProvider
:
createMockApollo
([[
query
,
jest
.
fn
().
mockResolvedValue
(
mockData
)]]),
propsData
:
{
propsData
:
{
query
,
query
,
...
...
ee/spec/frontend/security_dashboard/components/shared/selection_summary_spec.js
View file @
54d8e51b
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
SelectionSummary
from
'
ee/security_dashboard/components/shared/selection_summary.vue
'
;
import
SelectionSummary
from
'
ee/security_dashboard/components/shared/selection_summary.vue
'
;
import
StatusDropdown
from
'
ee/security_dashboard/components/shared/status_dropdown.vue
'
;
import
StatusDropdown
from
'
ee/security_dashboard/components/shared/status_dropdown.vue
'
;
...
@@ -11,8 +12,7 @@ import toast from '~/vue_shared/plugins/global_toast';
...
@@ -11,8 +12,7 @@ import toast from '~/vue_shared/plugins/global_toast';
jest
.
mock
(
'
~/vue_shared/plugins/global_toast
'
);
jest
.
mock
(
'
~/vue_shared/plugins/global_toast
'
);
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Selection Summary component
'
,
()
=>
{
describe
(
'
Selection Summary component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -29,7 +29,6 @@ describe('Selection Summary component', () => {
...
@@ -29,7 +29,6 @@ describe('Selection Summary component', () => {
const
createComponent
=
({
props
=
{},
apolloProvider
}
=
{})
=>
{
const
createComponent
=
({
props
=
{},
apolloProvider
}
=
{})
=>
{
wrapper
=
shallowMount
(
SelectionSummary
,
{
wrapper
=
shallowMount
(
SelectionSummary
,
{
localVue
,
apolloProvider
,
apolloProvider
,
stubs
:
{
stubs
:
{
GlAlert
,
GlAlert
,
...
...
ee/spec/frontend/security_dashboard/components/shared/vulnerability_report/vulnerability_counts_spec.js
View file @
54d8e51b
import
{
GlCard
,
GlSkeletonLoading
}
from
'
@gitlab/ui
'
;
import
{
GlCard
,
GlSkeletonLoading
}
from
'
@gitlab/ui
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VulnerabilityCounts
from
'
ee/security_dashboard/components/shared/vulnerability_report/vulnerability_counts.vue
'
;
import
VulnerabilityCounts
from
'
ee/security_dashboard/components/shared/vulnerability_report/vulnerability_counts.vue
'
;
import
{
mountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
mountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
...
@@ -13,8 +13,7 @@ import { SEVERITIES } from '~/vulnerabilities/constants';
...
@@ -13,8 +13,7 @@ import { SEVERITIES } from '~/vulnerabilities/constants';
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
fullPath
=
'
path
'
;
const
fullPath
=
'
path
'
;
const
counts
=
{
critical
:
1
,
high
:
2
,
medium
:
5
,
low
:
4
,
info
:
3
,
unknown
:
6
};
const
counts
=
{
critical
:
1
,
high
:
2
,
medium
:
5
,
low
:
4
,
info
:
3
,
unknown
:
6
};
...
@@ -44,7 +43,6 @@ describe('Vulnerability counts component', () => {
...
@@ -44,7 +43,6 @@ describe('Vulnerability counts component', () => {
countsHandler
=
defaultCountsRequestHandler
,
countsHandler
=
defaultCountsRequestHandler
,
}
=
{})
=>
{
}
=
{})
=>
{
wrapper
=
mountExtended
(
VulnerabilityCounts
,
{
wrapper
=
mountExtended
(
VulnerabilityCounts
,
{
localVue
,
apolloProvider
:
createMockApollo
([[
countsQuery
,
countsHandler
]]),
apolloProvider
:
createMockApollo
([[
countsQuery
,
countsHandler
]]),
provide
:
{
provide
:
{
fullPath
,
fullPath
,
...
...
ee/spec/frontend/security_dashboard/components/shared/vulnerability_report/vulnerability_list_graphql_spec.js
View file @
54d8e51b
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
nextTick
}
from
'
vue
'
;
import
{
GlIntersectionObserver
}
from
'
@gitlab/ui
'
;
import
{
GlIntersectionObserver
}
from
'
@gitlab/ui
'
;
import
VulnerabilityListGraphql
from
'
ee/security_dashboard/components/shared/vulnerability_report/vulnerability_list_graphql.vue
'
;
import
VulnerabilityListGraphql
from
'
ee/security_dashboard/components/shared/vulnerability_report/vulnerability_list_graphql.vue
'
;
import
VulnerabilityList
from
'
ee/security_dashboard/components/shared/vulnerability_report/vulnerability_list.vue
'
;
import
VulnerabilityList
from
'
ee/security_dashboard/components/shared/vulnerability_report/vulnerability_list.vue
'
;
...
@@ -12,8 +12,7 @@ import createFlash from '~/flash';
...
@@ -12,8 +12,7 @@ import createFlash from '~/flash';
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
fullPath
=
'
path
'
;
const
fullPath
=
'
path
'
;
const
portalName
=
'
portal-name
'
;
const
portalName
=
'
portal-name
'
;
...
@@ -45,7 +44,6 @@ describe('Vulnerability list GraphQL component', () => {
...
@@ -45,7 +44,6 @@ describe('Vulnerability list GraphQL component', () => {
fields
=
[],
fields
=
[],
}
=
{})
=>
{
}
=
{})
=>
{
wrapper
=
shallowMountExtended
(
VulnerabilityListGraphql
,
{
wrapper
=
shallowMountExtended
(
VulnerabilityListGraphql
,
{
localVue
,
apolloProvider
:
createMockApollo
([[
vulnerabilitiesQuery
,
vulnerabilitiesHandler
]]),
apolloProvider
:
createMockApollo
([[
vulnerabilitiesQuery
,
vulnerabilitiesHandler
]]),
provide
:
{
provide
:
{
fullPath
,
fullPath
,
...
...
ee/spec/frontend/sidebar/components/iteration_dropdown_spec.js
View file @
54d8e51b
...
@@ -6,15 +6,14 @@ import {
...
@@ -6,15 +6,14 @@ import {
GlDropdownSectionHeader
,
GlDropdownSectionHeader
,
GlSearchBoxByType
,
GlSearchBoxByType
,
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
{
mount
,
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
IterationDropdown
from
'
ee/sidebar/components/iteration_dropdown.vue
'
;
import
IterationDropdown
from
'
ee/sidebar/components/iteration_dropdown.vue
'
;
import
groupIterationsQuery
from
'
ee/sidebar/queries/iterations.query.graphql
'
;
import
groupIterationsQuery
from
'
ee/sidebar/queries/iterations.query.graphql
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
TEST_SEARCH
=
'
search
'
;
const
TEST_SEARCH
=
'
search
'
;
const
TEST_FULL_PATH
=
'
gitlab-test/test
'
;
const
TEST_FULL_PATH
=
'
gitlab-test/test
'
;
...
@@ -112,7 +111,6 @@ describe('IterationDropdown', () => {
...
@@ -112,7 +111,6 @@ describe('IterationDropdown', () => {
fakeApollo
=
createMockApollo
([[
groupIterationsQuery
,
groupIterationsSpy
]]);
fakeApollo
=
createMockApollo
([[
groupIterationsQuery
,
groupIterationsSpy
]]);
wrapper
=
mountFn
(
IterationDropdown
,
{
wrapper
=
mountFn
(
IterationDropdown
,
{
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
propsData
:
{
propsData
:
{
fullPath
:
TEST_FULL_PATH
,
fullPath
:
TEST_FULL_PATH
,
...
...
ee/spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js
View file @
54d8e51b
...
@@ -6,7 +6,8 @@ import {
...
@@ -6,7 +6,8 @@ import {
GlFormInput
,
GlFormInput
,
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
createLocalVue
,
mount
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
SidebarDropdownWidget
from
'
ee/sidebar/components/sidebar_dropdown_widget.vue
'
;
import
SidebarDropdownWidget
from
'
ee/sidebar/components/sidebar_dropdown_widget.vue
'
;
...
@@ -32,8 +33,6 @@ import {
...
@@ -32,8 +33,6 @@ import {
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
const
localVue
=
createLocalVue
();
describe
(
'
SidebarDropdownWidget
'
,
()
=>
{
describe
(
'
SidebarDropdownWidget
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
mockApollo
;
let
mockApollo
;
...
@@ -89,7 +88,7 @@ describe('SidebarDropdownWidget', () => {
...
@@ -89,7 +88,7 @@ describe('SidebarDropdownWidget', () => {
groupEpicsSpy
=
jest
.
fn
().
mockResolvedValue
(
mockGroupEpicsResponse
),
groupEpicsSpy
=
jest
.
fn
().
mockResolvedValue
(
mockGroupEpicsResponse
),
currentEpicSpy
=
jest
.
fn
().
mockResolvedValue
(
noCurrentEpicResponse
),
currentEpicSpy
=
jest
.
fn
().
mockResolvedValue
(
noCurrentEpicResponse
),
}
=
{})
=>
{
}
=
{})
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
mockApollo
=
createMockApollo
([
mockApollo
=
createMockApollo
([
[
groupEpicsQuery
,
groupEpicsSpy
],
[
groupEpicsQuery
,
groupEpicsSpy
],
[
projectIssueEpicQuery
,
currentEpicSpy
],
[
projectIssueEpicQuery
,
currentEpicSpy
],
...
@@ -98,7 +97,6 @@ describe('SidebarDropdownWidget', () => {
...
@@ -98,7 +97,6 @@ describe('SidebarDropdownWidget', () => {
wrapper
=
extendedWrapper
(
wrapper
=
extendedWrapper
(
mount
(
SidebarDropdownWidget
,
{
mount
(
SidebarDropdownWidget
,
{
localVue
,
provide
:
{
canUpdate
:
true
,
issuableAttributesQueries
},
provide
:
{
canUpdate
:
true
,
issuableAttributesQueries
},
apolloProvider
:
mockApollo
,
apolloProvider
:
mockApollo
,
propsData
:
{
propsData
:
{
...
...
ee/spec/frontend/sidebar/components/status/sidebar_status_spec.js
View file @
54d8e51b
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
SidebarStatus
from
'
ee/sidebar/components/status/sidebar_status.vue
'
;
import
SidebarStatus
from
'
ee/sidebar/components/status/sidebar_status.vue
'
;
import
Status
from
'
ee/sidebar/components/status/status.vue
'
;
import
Status
from
'
ee/sidebar/components/status/status.vue
'
;
...
@@ -6,8 +7,7 @@ import { healthStatusQueries } from 'ee/sidebar/constants';
...
@@ -6,8 +7,7 @@ import { healthStatusQueries } from 'ee/sidebar/constants';
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
getHealthStatusMutationResponse
,
getHealthStatusQueryResponse
}
from
'
./mock_data
'
;
import
{
getHealthStatusMutationResponse
,
getHealthStatusQueryResponse
}
from
'
./mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
createQueryHandler
=
({
state
,
healthStatus
})
=>
const
createQueryHandler
=
({
state
,
healthStatus
})
=>
jest
.
fn
().
mockResolvedValue
(
getHealthStatusQueryResponse
({
state
,
healthStatus
}));
jest
.
fn
().
mockResolvedValue
(
getHealthStatusQueryResponse
({
state
,
healthStatus
}));
...
@@ -35,7 +35,6 @@ describe('SidebarStatus', () => {
...
@@ -35,7 +35,6 @@ describe('SidebarStatus', () => {
healthStatus
=
'
onTrack
'
,
healthStatus
=
'
onTrack
'
,
}
=
{})
=>
{
}
=
{})
=>
{
wrapper
=
shallowMount
(
SidebarStatus
,
{
wrapper
=
shallowMount
(
SidebarStatus
,
{
localVue
,
propsData
:
{
propsData
:
{
issuableType
,
issuableType
,
iid
:
'
1
'
,
iid
:
'
1
'
,
...
...
ee/spec/frontend/subscriptions/buy_addons_shared/app_spec.js
View file @
54d8e51b
import
{
GlEmptyState
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
GlEmptyState
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
pick
}
from
'
lodash
'
;
import
{
pick
}
from
'
lodash
'
;
import
{
import
{
...
@@ -18,15 +18,13 @@ import waitForPromises from 'helpers/wait_for_promises';
...
@@ -18,15 +18,13 @@ import waitForPromises from 'helpers/wait_for_promises';
import
{
createMockApolloProvider
}
from
'
ee_jest/subscriptions/spec_helper
'
;
import
{
createMockApolloProvider
}
from
'
ee_jest/subscriptions/spec_helper
'
;
import
{
mockCiMinutesPlans
,
mockStoragePlans
}
from
'
ee_jest/subscriptions/mock_data
'
;
import
{
mockCiMinutesPlans
,
mockStoragePlans
}
from
'
ee_jest/subscriptions/mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Buy Addons Shared App
'
,
()
=>
{
describe
(
'
Buy Addons Shared App
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
async
function
createComponent
(
apolloProvider
,
injectedProps
)
{
async
function
createComponent
(
apolloProvider
,
injectedProps
)
{
wrapper
=
shallowMountExtended
(
App
,
{
wrapper
=
shallowMountExtended
(
App
,
{
localVue
,
apolloProvider
,
apolloProvider
,
provide
:
injectedProps
,
provide
:
injectedProps
,
stubs
:
{
stubs
:
{
...
...
ee/spec/frontend/subscriptions/buy_addons_shared/components/checkout/addon_purchase_details_spec.js
View file @
54d8e51b
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
{
merge
}
from
'
lodash
'
;
import
{
merge
}
from
'
lodash
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
stateData
as
initialStateData
}
from
'
ee_jest/subscriptions/mock_data
'
;
import
{
stateData
as
initialStateData
}
from
'
ee_jest/subscriptions/mock_data
'
;
...
@@ -11,8 +11,7 @@ import purchaseFlowResolvers from 'ee/vue_shared/purchase_flow/graphql/resolvers
...
@@ -11,8 +11,7 @@ import purchaseFlowResolvers from 'ee/vue_shared/purchase_flow/graphql/resolvers
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
mountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
mountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
AddonPurchaseDetails
'
,
()
=>
{
describe
(
'
AddonPurchaseDetails
'
,
()
=>
{
const
resolvers
=
{
...
purchaseFlowResolvers
,
...
subscriptionsResolvers
};
const
resolvers
=
{
...
purchaseFlowResolvers
,
...
subscriptionsResolvers
};
...
@@ -31,7 +30,6 @@ describe('AddonPurchaseDetails', () => {
...
@@ -31,7 +30,6 @@ describe('AddonPurchaseDetails', () => {
const
createComponent
=
(
stateData
=
{},
props
=
{})
=>
{
const
createComponent
=
(
stateData
=
{},
props
=
{})
=>
{
const
apolloProvider
=
createMockApolloProvider
(
stateData
);
const
apolloProvider
=
createMockApolloProvider
(
stateData
);
wrapper
=
mountExtended
(
AddonPurchaseDetails
,
{
wrapper
=
mountExtended
(
AddonPurchaseDetails
,
{
localVue
,
apolloProvider
,
apolloProvider
,
stubs
:
{
stubs
:
{
Step
,
Step
,
...
...
ee/spec/frontend/subscriptions/buy_addons_shared/components/checkout_spec.js
View file @
54d8e51b
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
{
merge
}
from
'
lodash
'
;
import
{
merge
}
from
'
lodash
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
BillingAddress
from
'
ee/vue_shared/purchase_flow/components/checkout/billing_address.vue
'
;
import
BillingAddress
from
'
ee/vue_shared/purchase_flow/components/checkout/billing_address.vue
'
;
...
@@ -19,8 +19,7 @@ import flushPromises from 'helpers/flush_promises';
...
@@ -19,8 +19,7 @@ import flushPromises from 'helpers/flush_promises';
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Checkout
'
,
()
=>
{
describe
(
'
Checkout
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -52,7 +51,6 @@ describe('Checkout', () => {
...
@@ -52,7 +51,6 @@ describe('Checkout', () => {
const
createComponent
=
(
stateData
=
{})
=>
{
const
createComponent
=
(
stateData
=
{})
=>
{
const
apolloProvider
=
createMockApolloProvider
(
stateData
);
const
apolloProvider
=
createMockApolloProvider
(
stateData
);
wrapper
=
shallowMountExtended
(
Checkout
,
{
wrapper
=
shallowMountExtended
(
Checkout
,
{
localVue
,
apolloProvider
,
apolloProvider
,
propsData
:
{
propsData
:
{
plan
,
plan
,
...
...
ee/spec/frontend/subscriptions/buy_addons_shared/components/order_summary_spec.js
View file @
54d8e51b
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
{
merge
}
from
'
lodash
'
;
import
{
merge
}
from
'
lodash
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
...
@@ -17,8 +17,7 @@ import waitForPromises from 'helpers/wait_for_promises';
...
@@ -17,8 +17,7 @@ import waitForPromises from 'helpers/wait_for_promises';
import
orderPreviewQuery
from
'
ee/subscriptions/graphql/queries/order_preview.customer.query.graphql
'
;
import
orderPreviewQuery
from
'
ee/subscriptions/graphql/queries/order_preview.customer.query.graphql
'
;
import
{
CUSTOMERSDOT_CLIENT
,
I18N_API_ERROR
}
from
'
ee/subscriptions/buy_addons_shared/constants
'
;
import
{
CUSTOMERSDOT_CLIENT
,
I18N_API_ERROR
}
from
'
ee/subscriptions/buy_addons_shared/constants
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Order Summary
'
,
()
=>
{
describe
(
'
Order Summary
'
,
()
=>
{
const
resolvers
=
{
...
purchaseFlowResolvers
,
...
subscriptionsResolvers
};
const
resolvers
=
{
...
purchaseFlowResolvers
,
...
subscriptionsResolvers
};
...
@@ -46,7 +45,6 @@ describe('Order Summary', () => {
...
@@ -46,7 +45,6 @@ describe('Order Summary', () => {
const
createComponent
=
(
apolloProvider
,
props
)
=>
{
const
createComponent
=
(
apolloProvider
,
props
)
=>
{
wrapper
=
shallowMountExtended
(
OrderSummary
,
{
wrapper
=
shallowMountExtended
(
OrderSummary
,
{
localVue
,
apolloProvider
,
apolloProvider
,
propsData
:
{
propsData
:
{
plan
:
mockStoragePlans
[
0
],
plan
:
mockStoragePlans
[
0
],
...
...
ee/spec/frontend/subscriptions/buy_minutes/components/checkout/billing_address_spec.js
View file @
54d8e51b
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
{
merge
}
from
'
lodash
'
;
import
{
merge
}
from
'
lodash
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
gitLabResolvers
}
from
'
ee/subscriptions/buy_addons_shared/graphql/resolvers
'
;
import
{
gitLabResolvers
}
from
'
ee/subscriptions/buy_addons_shared/graphql/resolvers
'
;
...
@@ -10,8 +11,7 @@ import { stateData as initialStateData } from 'ee_jest/subscriptions/mock_data';
...
@@ -10,8 +11,7 @@ import { stateData as initialStateData } from 'ee_jest/subscriptions/mock_data';
import
{
createMockApolloProvider
}
from
'
ee_jest/vue_shared/purchase_flow/spec_helper
'
;
import
{
createMockApolloProvider
}
from
'
ee_jest/vue_shared/purchase_flow/spec_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Billing Address
'
,
()
=>
{
describe
(
'
Billing Address
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -37,7 +37,6 @@ describe('Billing Address', () => {
...
@@ -37,7 +37,6 @@ describe('Billing Address', () => {
});
});
return
mount
(
BillingAddress
,
{
return
mount
(
BillingAddress
,
{
localVue
,
apolloProvider
,
apolloProvider
,
});
});
};
};
...
...
ee/spec/frontend/subscriptions/buy_minutes/components/checkout/confirm_order_spec.js
View file @
54d8e51b
import
{
GlButton
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
Api
from
'
ee/api
'
;
import
Api
from
'
ee/api
'
;
import
{
STEPS
}
from
'
ee/subscriptions/constants
'
;
import
{
STEPS
}
from
'
ee/subscriptions/constants
'
;
...
@@ -25,12 +26,10 @@ describe('Confirm Order', () => {
...
@@ -25,12 +26,10 @@ describe('Confirm Order', () => {
const
findConfirmButton
=
()
=>
wrapper
.
findComponent
(
GlButton
);
const
findConfirmButton
=
()
=>
wrapper
.
findComponent
(
GlButton
);
const
findLoadingIcon
=
()
=>
wrapper
.
findComponent
(
GlLoadingIcon
);
const
findLoadingIcon
=
()
=>
wrapper
.
findComponent
(
GlLoadingIcon
);
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
createComponent
=
(
options
=
{})
=>
{
const
createComponent
=
(
options
=
{})
=>
{
wrapper
=
extendedWrapper
(
wrapper
=
extendedWrapper
(
shallowMount
(
ConfirmOrder
,
{
shallowMount
(
ConfirmOrder
,
{
localVue
,
...
options
,
...
options
,
}),
}),
);
);
...
...
ee/spec/frontend/subscriptions/new/components/checkout/billing_address_spec.js
View file @
54d8e51b
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
{
STEPS
}
from
'
ee/subscriptions/constants
'
;
import
{
STEPS
}
from
'
ee/subscriptions/constants
'
;
...
@@ -10,9 +11,8 @@ import Step from 'ee/vue_shared/purchase_flow/components/step.vue';
...
@@ -10,9 +11,8 @@ import Step from 'ee/vue_shared/purchase_flow/components/step.vue';
import
activateNextStepMutation
from
'
ee/vue_shared/purchase_flow/graphql/mutations/activate_next_step.mutation.graphql
'
;
import
activateNextStepMutation
from
'
ee/vue_shared/purchase_flow/graphql/mutations/activate_next_step.mutation.graphql
'
;
import
{
createMockApolloProvider
}
from
'
ee_jest/vue_shared/purchase_flow/spec_helper
'
;
import
{
createMockApolloProvider
}
from
'
ee_jest/vue_shared/purchase_flow/spec_helper
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
Vuex
);
localVue
.
use
(
Vuex
);
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Billing Address
'
,
()
=>
{
describe
(
'
Billing Address
'
,
()
=>
{
let
store
;
let
store
;
...
@@ -40,7 +40,6 @@ describe('Billing Address', () => {
...
@@ -40,7 +40,6 @@ describe('Billing Address', () => {
function
createComponent
(
options
=
{})
{
function
createComponent
(
options
=
{})
{
return
mount
(
BillingAddress
,
{
return
mount
(
BillingAddress
,
{
localVue
,
...
options
,
...
options
,
});
});
}
}
...
...
ee/spec/frontend/subscriptions/new/components/checkout/confirm_order_spec.js
View file @
54d8e51b
import
{
GlButton
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
Api
from
'
ee/api
'
;
import
Api
from
'
ee/api
'
;
...
@@ -13,9 +14,8 @@ import flash from '~/flash';
...
@@ -13,9 +14,8 @@ import flash from '~/flash';
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
describe
(
'
Confirm Order
'
,
()
=>
{
describe
(
'
Confirm Order
'
,
()
=>
{
const
localVue
=
createLocalVue
();
Vue
.
use
(
Vuex
);
localVue
.
use
(
Vuex
);
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
let
wrapper
;
let
wrapper
;
...
@@ -25,7 +25,6 @@ describe('Confirm Order', () => {
...
@@ -25,7 +25,6 @@ describe('Confirm Order', () => {
function
createComponent
(
options
=
{})
{
function
createComponent
(
options
=
{})
{
return
shallowMount
(
ConfirmOrder
,
{
return
shallowMount
(
ConfirmOrder
,
{
localVue
,
store
,
store
,
...
options
,
...
options
,
});
});
...
...
ee/spec/frontend/subscriptions/new/components/checkout/payment_method_spec.js
View file @
54d8e51b
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
{
STEPS
}
from
'
ee/subscriptions/constants
'
;
import
{
STEPS
}
from
'
ee/subscriptions/constants
'
;
...
@@ -10,16 +10,14 @@ import Step from 'ee/vue_shared/purchase_flow/components/step.vue';
...
@@ -10,16 +10,14 @@ import Step from 'ee/vue_shared/purchase_flow/components/step.vue';
import
{
createMockApolloProvider
}
from
'
ee_jest/vue_shared/purchase_flow/spec_helper
'
;
import
{
createMockApolloProvider
}
from
'
ee_jest/vue_shared/purchase_flow/spec_helper
'
;
describe
(
'
Payment Method
'
,
()
=>
{
describe
(
'
Payment Method
'
,
()
=>
{
const
localVue
=
createLocalVue
();
Vue
.
use
(
Vuex
);
localVue
.
use
(
Vuex
);
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
let
store
;
let
store
;
let
wrapper
;
let
wrapper
;
function
createComponent
(
options
=
{})
{
function
createComponent
(
options
=
{})
{
return
mount
(
PaymentMethod
,
{
return
mount
(
PaymentMethod
,
{
localVue
,
store
,
store
,
...
options
,
...
options
,
});
});
...
...
ee/spec/frontend/subscriptions/new/components/checkout/subscription_details_spec.js
View file @
54d8e51b
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
{
STEPS
}
from
'
ee/subscriptions/constants
'
;
import
{
STEPS
}
from
'
ee/subscriptions/constants
'
;
...
@@ -30,16 +30,14 @@ const createDefaultInitialStoreData = (initialData) => ({
...
@@ -30,16 +30,14 @@ const createDefaultInitialStoreData = (initialData) => ({
});
});
describe
(
'
Subscription Details
'
,
()
=>
{
describe
(
'
Subscription Details
'
,
()
=>
{
const
localVue
=
createLocalVue
();
Vue
.
use
(
Vuex
);
localVue
.
use
(
Vuex
);
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
let
wrapper
;
let
wrapper
;
function
createComponent
(
options
=
{})
{
function
createComponent
(
options
=
{})
{
const
{
apolloProvider
,
store
}
=
options
;
const
{
apolloProvider
,
store
}
=
options
;
return
mount
(
Component
,
{
return
mount
(
Component
,
{
localVue
,
store
,
store
,
apolloProvider
,
apolloProvider
,
stubs
:
{
stubs
:
{
...
...
ee/spec/frontend/threat_monitoring/components/instance_project_selector_spec.js
View file @
54d8e51b
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
InstanceProjectSelector
from
'
ee/threat_monitoring/components/instance_project_selector.vue
'
;
import
InstanceProjectSelector
from
'
ee/threat_monitoring/components/instance_project_selector.vue
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
@@ -7,7 +7,6 @@ import waitForPromises from 'helpers/wait_for_promises';
...
@@ -7,7 +7,6 @@ import waitForPromises from 'helpers/wait_for_promises';
import
getUsersProjects
from
'
~/graphql_shared/queries/get_users_projects.query.graphql
'
;
import
getUsersProjects
from
'
~/graphql_shared/queries/get_users_projects.query.graphql
'
;
import
ProjectSelector
from
'
~/vue_shared/components/project_selector/project_selector.vue
'
;
import
ProjectSelector
from
'
~/vue_shared/components/project_selector/project_selector.vue
'
;
const
localVue
=
createLocalVue
();
let
querySpy
;
let
querySpy
;
const
defaultProjectSelectorProps
=
{
const
defaultProjectSelectorProps
=
{
...
@@ -72,7 +71,7 @@ const mockGetUsersProjects = {
...
@@ -72,7 +71,7 @@ const mockGetUsersProjects = {
};
};
const
createMockApolloProvider
=
(
queryResolver
)
=>
{
const
createMockApolloProvider
=
(
queryResolver
)
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
return
createMockApollo
([[
getUsersProjects
,
queryResolver
]]);
return
createMockApollo
([[
getUsersProjects
,
queryResolver
]]);
};
};
...
@@ -83,7 +82,6 @@ describe('InstanceProjectSelector Component', () => {
...
@@ -83,7 +82,6 @@ describe('InstanceProjectSelector Component', () => {
const
createWrapper
=
({
queryResolver
,
propsData
=
{}
}
=
{})
=>
{
const
createWrapper
=
({
queryResolver
,
propsData
=
{}
}
=
{})
=>
{
wrapper
=
shallowMountExtended
(
InstanceProjectSelector
,
{
wrapper
=
shallowMountExtended
(
InstanceProjectSelector
,
{
localVue
,
apolloProvider
:
createMockApolloProvider
(
queryResolver
),
apolloProvider
:
createMockApolloProvider
(
queryResolver
),
propsData
:
{
propsData
:
{
...
propsData
,
...
propsData
,
...
...
ee/spec/frontend/threat_monitoring/components/policies/policies_list_spec.js
View file @
54d8e51b
import
{
GlTable
,
GlDrawer
}
from
'
@gitlab/ui
'
;
import
{
GlTable
,
GlDrawer
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
{
merge
}
from
'
lodash
'
;
import
{
merge
}
from
'
lodash
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
POLICY_TYPE_OPTIONS
}
from
'
ee/threat_monitoring/components/constants
'
;
import
{
POLICY_TYPE_OPTIONS
}
from
'
ee/threat_monitoring/components/constants
'
;
...
@@ -25,8 +25,7 @@ import {
...
@@ -25,8 +25,7 @@ import {
mockScanResultPoliciesResponse
,
mockScanResultPoliciesResponse
,
}
from
'
../../mocks/mock_data
'
;
}
from
'
../../mocks/mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
fullPath
=
'
project/path
'
;
const
fullPath
=
'
project/path
'
;
const
environments
=
[
const
environments
=
[
...
@@ -105,7 +104,6 @@ describe('PoliciesList component', () => {
...
@@ -105,7 +104,6 @@ describe('PoliciesList component', () => {
}),
}),
NoPoliciesEmptyState
:
true
,
NoPoliciesEmptyState
:
true
,
},
},
localVue
,
},
},
wrapperOptions
,
wrapperOptions
,
),
),
...
...
ee/spec/frontend/threat_monitoring/components/policies/scan_new_policy_modal_spec.js
View file @
54d8e51b
import
{
GlDropdown
,
GlModal
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
GlDropdown
,
GlModal
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
InstanceProjectSelector
from
'
ee/threat_monitoring/components/instance_project_selector.vue
'
;
import
InstanceProjectSelector
from
'
ee/threat_monitoring/components/instance_project_selector.vue
'
;
import
ScanNewPolicyModal
from
'
ee/threat_monitoring/components/policies/scan_new_policy_modal.vue
'
;
import
ScanNewPolicyModal
from
'
ee/threat_monitoring/components/policies/scan_new_policy_modal.vue
'
;
...
@@ -14,8 +14,7 @@ import {
...
@@ -14,8 +14,7 @@ import {
mockUnlinkSecurityPolicyProjectResponses
,
mockUnlinkSecurityPolicyProjectResponses
,
}
from
'
../../mocks/mock_apollo
'
;
}
from
'
../../mocks/mock_apollo
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
ScanNewPolicyModal Component
'
,
()
=>
{
describe
(
'
ScanNewPolicyModal Component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -49,7 +48,6 @@ describe('ScanNewPolicyModal Component', () => {
...
@@ -49,7 +48,6 @@ describe('ScanNewPolicyModal Component', () => {
provide
=
{},
provide
=
{},
}
=
{})
=>
{
}
=
{})
=>
{
wrapper
=
mountExtended
(
ScanNewPolicyModal
,
{
wrapper
=
mountExtended
(
ScanNewPolicyModal
,
{
localVue
,
apolloProvider
:
createMockApollo
([[
mutationQuery
,
mutationResult
]]),
apolloProvider
:
createMockApollo
([[
mutationQuery
,
mutationResult
]]),
stubs
:
{
stubs
:
{
GlModal
:
stubComponent
(
GlModal
,
{
GlModal
:
stubComponent
(
GlModal
,
{
...
...
ee/spec/frontend/threat_monitoring/components/policy_editor/policy_alert_picker_spec.js
View file @
54d8e51b
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
PolicyAlertPicker
from
'
ee/threat_monitoring/components/policy_editor/policy_alert_picker.vue
'
;
import
PolicyAlertPicker
from
'
ee/threat_monitoring/components/policy_editor/policy_alert_picker.vue
'
;
import
getAgentCount
from
'
ee/threat_monitoring/graphql/queries/get_agent_count.query.graphql
'
;
import
getAgentCount
from
'
ee/threat_monitoring/graphql/queries/get_agent_count.query.graphql
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
PolicyAlertPicker component
'
,
()
=>
{
describe
(
'
PolicyAlertPicker component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -33,7 +33,6 @@ describe('PolicyAlertPicker component', () => {
...
@@ -33,7 +33,6 @@ describe('PolicyAlertPicker component', () => {
wrapper
=
extendedWrapper
(
wrapper
=
extendedWrapper
(
shallowMount
(
PolicyAlertPicker
,
{
shallowMount
(
PolicyAlertPicker
,
{
apolloProvider
,
apolloProvider
,
localVue
,
propsData
:
{
propsData
:
{
...
propsData
,
...
propsData
,
},
},
...
...
ee/spec/frontend/trials/components/country_or_region_selector_spec.js
View file @
54d8e51b
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
@@ -6,8 +6,7 @@ import CountryOrRegionSelector from 'ee/trials/components/country_or_region_sele
...
@@ -6,8 +6,7 @@ import CountryOrRegionSelector from 'ee/trials/components/country_or_region_sele
import
{
countries
,
states
}
from
'
../../hand_raise_leads/components/mock_data
'
;
import
{
countries
,
states
}
from
'
../../hand_raise_leads/components/mock_data
'
;
import
{
formData
}
from
'
./mock_data
'
;
import
{
formData
}
from
'
./mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
CountryOrRegionSelector
'
,
()
=>
{
describe
(
'
CountryOrRegionSelector
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -25,7 +24,6 @@ describe('CountryOrRegionSelector', () => {
...
@@ -25,7 +24,6 @@ describe('CountryOrRegionSelector', () => {
};
};
return
mountFunction
(
CountryOrRegionSelector
,
{
return
mountFunction
(
CountryOrRegionSelector
,
{
localVue
,
apolloProvider
:
createMockApollo
([],
mockResolvers
),
apolloProvider
:
createMockApollo
([],
mockResolvers
),
provide
:
{
provide
:
{
user
:
formData
,
user
:
formData
,
...
...
ee/spec/frontend/usage_quotas/storage/components/project_storage_app_spec.js
View file @
54d8e51b
import
{
GlAlert
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
...
@@ -15,8 +16,7 @@ import {
...
@@ -15,8 +16,7 @@ import {
defaultProjectProvideValues
,
defaultProjectProvideValues
,
}
from
'
../mock_data
'
;
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
ProjectStorageApp
'
,
()
=>
{
describe
(
'
ProjectStorageApp
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -38,7 +38,6 @@ describe('ProjectStorageApp', () => {
...
@@ -38,7 +38,6 @@ describe('ProjectStorageApp', () => {
const
createComponent
=
({
provide
=
{},
mockApollo
}
=
{})
=>
{
const
createComponent
=
({
provide
=
{},
mockApollo
}
=
{})
=>
{
wrapper
=
extendedWrapper
(
wrapper
=
extendedWrapper
(
shallowMount
(
ProjectStorageApp
,
{
shallowMount
(
ProjectStorageApp
,
{
localVue
,
apolloProvider
:
mockApollo
,
apolloProvider
:
mockApollo
,
provide
:
{
provide
:
{
...
defaultProjectProvideValues
,
...
defaultProjectProvideValues
,
...
...
ee/spec/frontend/vue_shared/discover/card_security_discover_app_spec.js
View file @
54d8e51b
import
{
shallowMount
,
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
,
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
stubExperiments
}
from
'
helpers/experimentation_helper
'
;
import
{
stubExperiments
}
from
'
helpers/experimentation_helper
'
;
...
@@ -8,8 +9,7 @@ import HandRaiseLeadButton from 'ee/hand_raise_leads/hand_raise_lead/components/
...
@@ -8,8 +9,7 @@ import HandRaiseLeadButton from 'ee/hand_raise_leads/hand_raise_lead/components/
import
{
mockTracking
}
from
'
helpers/tracking_helper
'
;
import
{
mockTracking
}
from
'
helpers/tracking_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Card security discover app
'
,
()
=>
{
describe
(
'
Card security discover app
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -24,7 +24,6 @@ describe('Card security discover app', () => {
...
@@ -24,7 +24,6 @@ describe('Card security discover app', () => {
linkSecondary
:
'
/link/secondary
'
,
linkSecondary
:
'
/link/secondary
'
,
};
};
wrapper
=
mountFn
(
CardSecurityDiscoverApp
,
{
wrapper
=
mountFn
(
CardSecurityDiscoverApp
,
{
localVue
,
propsData
,
propsData
,
apolloProvider
:
createMockApollo
([],
{}),
apolloProvider
:
createMockApollo
([],
{}),
provide
:
{
provide
:
{
...
...
ee/spec/frontend/vulnerabilities/header_spec.js
View file @
54d8e51b
import
{
GlButton
,
GlBadge
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlBadge
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
Api
from
'
ee/api
'
;
import
Api
from
'
ee/api
'
;
...
@@ -23,8 +24,7 @@ import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils';
...
@@ -23,8 +24,7 @@ import { convertObjectPropsToSnakeCase } from '~/lib/utils/common_utils';
import
download
from
'
~/lib/utils/downloader
'
;
import
download
from
'
~/lib/utils/downloader
'
;
import
*
as
urlUtility
from
'
~/lib/utils/url_utility
'
;
import
*
as
urlUtility
from
'
~/lib/utils/url_utility
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
vulnerabilityStateEntries
=
Object
.
entries
(
VULNERABILITY_STATE_OBJECTS
);
const
vulnerabilityStateEntries
=
Object
.
entries
(
VULNERABILITY_STATE_OBJECTS
);
const
mockAxios
=
new
MockAdapter
(
axios
);
const
mockAxios
=
new
MockAdapter
(
axios
);
...
@@ -90,7 +90,6 @@ describe('Vulnerability Header', () => {
...
@@ -90,7 +90,6 @@ describe('Vulnerability Header', () => {
const
createWrapper
=
({
vulnerability
=
{},
apolloProvider
})
=>
{
const
createWrapper
=
({
vulnerability
=
{},
apolloProvider
})
=>
{
wrapper
=
shallowMount
(
Header
,
{
wrapper
=
shallowMount
(
Header
,
{
localVue
,
apolloProvider
,
apolloProvider
,
propsData
:
{
propsData
:
{
vulnerability
:
{
vulnerability
:
{
...
...
ee/spec/frontend/vulnerabilities/vulnerability_spec.js
View file @
54d8e51b
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
fetchHeaderVulnerabilityQuery
from
'
ee/security_dashboard/graphql/header_vulnerability.graphql
'
;
import
fetchHeaderVulnerabilityQuery
from
'
ee/security_dashboard/graphql/header_vulnerability.graphql
'
;
import
FalsePositiveAlert
from
'
ee/vulnerabilities/components/false_positive_alert.vue
'
;
import
FalsePositiveAlert
from
'
ee/vulnerabilities/components/false_positive_alert.vue
'
;
...
@@ -11,8 +12,7 @@ import createMockApollo from 'helpers/mock_apollo_helper';
...
@@ -11,8 +12,7 @@ import createMockApollo from 'helpers/mock_apollo_helper';
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
createFlash
from
'
~/flash
'
;
import
createFlash
from
'
~/flash
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
describe
(
'
Vulnerability
'
,
()
=>
{
describe
(
'
Vulnerability
'
,
()
=>
{
...
@@ -73,7 +73,6 @@ describe('Vulnerability', () => {
...
@@ -73,7 +73,6 @@ describe('Vulnerability', () => {
const
createWrapper
=
({
vulnData
,
apolloProvider
}
=
{})
=>
{
const
createWrapper
=
({
vulnData
,
apolloProvider
}
=
{})
=>
{
wrapper
=
shallowMount
(
Main
,
{
wrapper
=
shallowMount
(
Main
,
{
localVue
,
apolloProvider
,
apolloProvider
,
propsData
:
{
propsData
:
{
initialVulnerability
:
{
...
getVulnerability
(),
...
vulnData
},
initialVulnerability
:
{
...
getVulnerability
(),
...
vulnData
},
...
...
spec/frontend/alerts_settings/components/alerts_settings_wrapper_spec.js
View file @
54d8e51b
import
{
GlLoadingIcon
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
AxiosMockAdapter
from
'
axios-mock-adapter
'
;
import
AxiosMockAdapter
from
'
axios-mock-adapter
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createHttpIntegrationMutation
from
'
ee_else_ce/alerts_settings/graphql/mutations/create_http_integration.mutation.graphql
'
;
import
createHttpIntegrationMutation
from
'
ee_else_ce/alerts_settings/graphql/mutations/create_http_integration.mutation.graphql
'
;
import
updateHttpIntegrationMutation
from
'
ee_else_ce/alerts_settings/graphql/mutations/update_http_integration.mutation.graphql
'
;
import
updateHttpIntegrationMutation
from
'
ee_else_ce/alerts_settings/graphql/mutations/update_http_integration.mutation.graphql
'
;
...
@@ -49,8 +50,6 @@ import mockIntegrations from './mocks/integrations.json';
...
@@ -49,8 +50,6 @@ import mockIntegrations from './mocks/integrations.json';
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
const
localVue
=
createLocalVue
();
describe
(
'
AlertsSettingsWrapper
'
,
()
=>
{
describe
(
'
AlertsSettingsWrapper
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
fakeApollo
;
let
fakeApollo
;
...
@@ -111,7 +110,7 @@ describe('AlertsSettingsWrapper', () => {
...
@@ -111,7 +110,7 @@ describe('AlertsSettingsWrapper', () => {
function
createComponentWithApollo
({
function
createComponentWithApollo
({
destroyHandler
=
jest
.
fn
().
mockResolvedValue
(
destroyIntegrationResponse
),
destroyHandler
=
jest
.
fn
().
mockResolvedValue
(
destroyIntegrationResponse
),
}
=
{})
{
}
=
{})
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
destroyIntegrationHandler
=
destroyHandler
;
destroyIntegrationHandler
=
destroyHandler
;
const
requestHandlers
=
[
const
requestHandlers
=
[
...
@@ -122,7 +121,6 @@ describe('AlertsSettingsWrapper', () => {
...
@@ -122,7 +121,6 @@ describe('AlertsSettingsWrapper', () => {
fakeApollo
=
createMockApollo
(
requestHandlers
);
fakeApollo
=
createMockApollo
(
requestHandlers
);
wrapper
=
mount
(
AlertsSettingsWrapper
,
{
wrapper
=
mount
(
AlertsSettingsWrapper
,
{
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
provide
:
{
provide
:
{
alertSettings
:
{
alertSettings
:
{
...
...
spec/frontend/artifacts_settings/components/keep_latest_artifact_checkbox_spec.js
View file @
54d8e51b
import
{
GlFormCheckbox
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlFormCheckbox
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
UpdateKeepLatestArtifactProjectSetting
from
'
~/artifacts_settings/graphql/mutations/update_keep_latest_artifact_project_setting.mutation.graphql
'
;
import
UpdateKeepLatestArtifactProjectSetting
from
'
~/artifacts_settings/graphql/mutations/update_keep_latest_artifact_project_setting.mutation.graphql
'
;
...
@@ -7,8 +8,7 @@ import GetKeepLatestArtifactApplicationSetting from '~/artifacts_settings/graphq
...
@@ -7,8 +8,7 @@ import GetKeepLatestArtifactApplicationSetting from '~/artifacts_settings/graphq
import
GetKeepLatestArtifactProjectSetting
from
'
~/artifacts_settings/graphql/queries/get_keep_latest_artifact_project_setting.query.graphql
'
;
import
GetKeepLatestArtifactProjectSetting
from
'
~/artifacts_settings/graphql/queries/get_keep_latest_artifact_project_setting.query.graphql
'
;
import
KeepLatestArtifactCheckbox
from
'
~/artifacts_settings/keep_latest_artifact_checkbox.vue
'
;
import
KeepLatestArtifactCheckbox
from
'
~/artifacts_settings/keep_latest_artifact_checkbox.vue
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
keepLatestArtifactProjectMock
=
{
const
keepLatestArtifactProjectMock
=
{
data
:
{
data
:
{
...
@@ -73,7 +73,6 @@ describe('Keep latest artifact checkbox', () => {
...
@@ -73,7 +73,6 @@ describe('Keep latest artifact checkbox', () => {
stubs
:
{
stubs
:
{
GlFormCheckbox
,
GlFormCheckbox
,
},
},
localVue
,
apolloProvider
,
apolloProvider
,
});
});
};
};
...
...
spec/frontend/boards/board_list_helper.js
View file @
54d8e51b
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
...
@@ -33,9 +34,8 @@ export default function createComponent({
...
@@ -33,9 +34,8 @@ export default function createComponent({
},
},
issuesCount
,
issuesCount
,
}
=
{})
{
}
=
{})
{
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
Vue
.
use
(
Vuex
);
localVue
.
use
(
Vuex
);
const
fakeApollo
=
createMockApollo
([
const
fakeApollo
=
createMockApollo
([
[
listQuery
,
jest
.
fn
().
mockResolvedValue
(
boardListQueryResponse
(
issuesCount
))],
[
listQuery
,
jest
.
fn
().
mockResolvedValue
(
boardListQueryResponse
(
issuesCount
))],
...
@@ -85,7 +85,6 @@ export default function createComponent({
...
@@ -85,7 +85,6 @@ export default function createComponent({
const
component
=
shallowMount
(
BoardList
,
{
const
component
=
shallowMount
(
BoardList
,
{
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
localVue
,
store
,
store
,
propsData
:
{
propsData
:
{
disabled
:
false
,
disabled
:
false
,
...
...
spec/frontend/clusters_list/components/install_agent_modal_spec.js
View file @
54d8e51b
import
{
GlAlert
,
GlButton
,
GlFormInputGroup
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
GlButton
,
GlFormInputGroup
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
sprintf
}
from
'
~/locale
'
;
import
{
sprintf
}
from
'
~/locale
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
...
@@ -32,8 +32,7 @@ import {
...
@@ -32,8 +32,7 @@ import {
}
from
'
../mocks/apollo
'
;
}
from
'
../mocks/apollo
'
;
import
ModalStub
from
'
../stubs
'
;
import
ModalStub
from
'
../stubs
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
projectPath
=
'
path/to/project
'
;
const
projectPath
=
'
path/to/project
'
;
const
kasAddress
=
'
kas.example.com
'
;
const
kasAddress
=
'
kas.example.com
'
;
...
@@ -95,7 +94,6 @@ describe('InstallAgentModal', () => {
...
@@ -95,7 +94,6 @@ describe('InstallAgentModal', () => {
GlSprintf
,
GlSprintf
,
GlModal
:
ModalStub
,
GlModal
:
ModalStub
,
},
},
localVue
,
apolloProvider
,
apolloProvider
,
provide
,
provide
,
propsData
,
propsData
,
...
...
spec/frontend/design_management/pages/index_spec.js
View file @
54d8e51b
import
{
GlEmptyState
}
from
'
@gitlab/ui
'
;
import
{
GlEmptyState
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
,
{
ApolloMutation
}
from
'
vue-apollo
'
;
import
VueApollo
,
{
ApolloMutation
}
from
'
vue-apollo
'
;
import
VueRouter
from
'
vue-router
'
;
import
VueRouter
from
'
vue-router
'
;
import
VueDraggable
from
'
vuedraggable
'
;
import
VueDraggable
from
'
vuedraggable
'
;
...
@@ -49,9 +50,8 @@ jest.spyOn(utils, 'getPageLayoutElement').mockReturnValue(mockPageEl);
...
@@ -49,9 +50,8 @@ jest.spyOn(utils, 'getPageLayoutElement').mockReturnValue(mockPageEl);
const
scrollIntoViewMock
=
jest
.
fn
();
const
scrollIntoViewMock
=
jest
.
fn
();
HTMLElement
.
prototype
.
scrollIntoView
=
scrollIntoViewMock
;
HTMLElement
.
prototype
.
scrollIntoView
=
scrollIntoViewMock
;
const
localVue
=
createLocalVue
();
const
router
=
createRouter
();
const
router
=
createRouter
();
local
Vue
.
use
(
VueRouter
);
Vue
.
use
(
VueRouter
);
const
mockDesigns
=
[
const
mockDesigns
=
[
{
{
...
@@ -159,7 +159,6 @@ describe('Design management index page', () => {
...
@@ -159,7 +159,6 @@ describe('Design management index page', () => {
};
};
},
},
mocks
:
{
$apollo
},
mocks
:
{
$apollo
},
localVue
,
router
,
router
,
stubs
:
{
DesignDestroyer
,
ApolloMutation
,
VueDraggable
,
...
stubs
},
stubs
:
{
DesignDestroyer
,
ApolloMutation
,
VueDraggable
,
...
stubs
},
attachTo
:
document
.
body
,
attachTo
:
document
.
body
,
...
@@ -175,7 +174,7 @@ describe('Design management index page', () => {
...
@@ -175,7 +174,7 @@ describe('Design management index page', () => {
function
createComponentWithApollo
({
function
createComponentWithApollo
({
moveHandler
=
jest
.
fn
().
mockResolvedValue
(
moveDesignMutationResponse
),
moveHandler
=
jest
.
fn
().
mockResolvedValue
(
moveDesignMutationResponse
),
})
{
})
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
moveDesignHandler
=
moveHandler
;
moveDesignHandler
=
moveHandler
;
const
requestHandlers
=
[
const
requestHandlers
=
[
...
@@ -186,7 +185,6 @@ describe('Design management index page', () => {
...
@@ -186,7 +185,6 @@ describe('Design management index page', () => {
fakeApollo
=
createMockApollo
(
requestHandlers
);
fakeApollo
=
createMockApollo
(
requestHandlers
);
wrapper
=
shallowMount
(
Index
,
{
wrapper
=
shallowMount
(
Index
,
{
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
router
,
router
,
stubs
:
{
VueDraggable
},
stubs
:
{
VueDraggable
},
...
...
spec/frontend/issues/list/components/new_issue_dropdown_spec.js
View file @
54d8e51b
import
{
GlDropdown
,
GlDropdownItem
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
import
{
GlDropdown
,
GlDropdownItem
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -17,8 +18,7 @@ import {
...
@@ -17,8 +18,7 @@ import {
describe
(
'
NewIssueDropdown component
'
,
()
=>
{
describe
(
'
NewIssueDropdown component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
mountComponent
=
({
const
mountComponent
=
({
search
=
''
,
search
=
''
,
...
@@ -29,7 +29,6 @@ describe('NewIssueDropdown component', () => {
...
@@ -29,7 +29,6 @@ describe('NewIssueDropdown component', () => {
const
apolloProvider
=
createMockApollo
(
requestHandlers
);
const
apolloProvider
=
createMockApollo
(
requestHandlers
);
return
mountFn
(
NewIssueDropdown
,
{
return
mountFn
(
NewIssueDropdown
,
{
localVue
,
apolloProvider
,
apolloProvider
,
provide
:
{
provide
:
{
fullPath
:
'
mushroom-kingdom
'
,
fullPath
:
'
mushroom-kingdom
'
,
...
...
spec/frontend/issues/show/components/fields/type_spec.js
View file @
54d8e51b
import
{
GlFormGroup
,
GlDropdown
,
GlDropdownItem
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlFormGroup
,
GlDropdown
,
GlDropdownItem
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -10,8 +11,7 @@ import {
...
@@ -10,8 +11,7 @@ import {
updateIssueStateQueryResponse
,
updateIssueStateQueryResponse
,
}
from
'
../../mock_data/apollo_mock
'
;
}
from
'
../../mock_data/apollo_mock
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Issue type field component
'
,
()
=>
{
describe
(
'
Issue type field component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -43,7 +43,6 @@ describe('Issue type field component', () => {
...
@@ -43,7 +43,6 @@ describe('Issue type field component', () => {
fakeApollo
=
createMockApollo
([],
mockResolvers
);
fakeApollo
=
createMockApollo
([],
mockResolvers
);
wrapper
=
shallowMount
(
IssueTypeField
,
{
wrapper
=
shallowMount
(
IssueTypeField
,
{
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
data
()
{
data
()
{
return
{
return
{
...
...
spec/frontend/jira_connect/branches/components/new_branch_form_spec.js
View file @
54d8e51b
import
{
GlAlert
,
GlForm
,
GlFormInput
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
GlForm
,
GlFormInput
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -45,8 +46,6 @@ const mockCreateBranchMutationWithErrors = jest
...
@@ -45,8 +46,6 @@ const mockCreateBranchMutationWithErrors = jest
const
mockCreateBranchMutationFailed
=
jest
.
fn
().
mockRejectedValue
(
new
Error
(
'
GraphQL error
'
));
const
mockCreateBranchMutationFailed
=
jest
.
fn
().
mockRejectedValue
(
new
Error
(
'
GraphQL error
'
));
const
mockMutationLoading
=
jest
.
fn
().
mockReturnValue
(
new
Promise
(()
=>
{}));
const
mockMutationLoading
=
jest
.
fn
().
mockReturnValue
(
new
Promise
(()
=>
{}));
const
localVue
=
createLocalVue
();
describe
(
'
NewBranchForm
'
,
()
=>
{
describe
(
'
NewBranchForm
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -66,7 +65,7 @@ describe('NewBranchForm', () => {
...
@@ -66,7 +65,7 @@ describe('NewBranchForm', () => {
function
createMockApolloProvider
({
function
createMockApolloProvider
({
mockCreateBranchMutation
=
mockCreateBranchMutationSuccess
,
mockCreateBranchMutation
=
mockCreateBranchMutationSuccess
,
}
=
{})
{
}
=
{})
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
mockApollo
=
createMockApollo
([[
createBranchMutation
,
mockCreateBranchMutation
]]);
const
mockApollo
=
createMockApollo
([[
createBranchMutation
,
mockCreateBranchMutation
]]);
...
@@ -75,7 +74,6 @@ describe('NewBranchForm', () => {
...
@@ -75,7 +74,6 @@ describe('NewBranchForm', () => {
function
createComponent
({
mockApollo
,
provide
}
=
{})
{
function
createComponent
({
mockApollo
,
provide
}
=
{})
{
wrapper
=
shallowMount
(
NewBranchForm
,
{
wrapper
=
shallowMount
(
NewBranchForm
,
{
localVue
,
apolloProvider
:
mockApollo
||
createMockApolloProvider
(),
apolloProvider
:
mockApollo
||
createMockApolloProvider
(),
provide
:
{
provide
:
{
initialBranchName
:
''
,
initialBranchName
:
''
,
...
...
spec/frontend/jira_connect/branches/components/project_dropdown_spec.js
View file @
54d8e51b
import
{
GlDropdown
,
GlDropdownItem
,
GlLoadingIcon
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
import
{
GlDropdown
,
GlDropdownItem
,
GlLoadingIcon
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
import
{
mount
,
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -7,8 +8,6 @@ import ProjectDropdown from '~/jira_connect/branches/components/project_dropdown
...
@@ -7,8 +8,6 @@ import ProjectDropdown from '~/jira_connect/branches/components/project_dropdown
import
{
PROJECTS_PER_PAGE
}
from
'
~/jira_connect/branches/constants
'
;
import
{
PROJECTS_PER_PAGE
}
from
'
~/jira_connect/branches/constants
'
;
import
getProjectsQuery
from
'
~/jira_connect/branches/graphql/queries/get_projects.query.graphql
'
;
import
getProjectsQuery
from
'
~/jira_connect/branches/graphql/queries/get_projects.query.graphql
'
;
const
localVue
=
createLocalVue
();
const
mockProjects
=
[
const
mockProjects
=
[
{
{
id
:
'
test
'
,
id
:
'
test
'
,
...
@@ -62,7 +61,7 @@ describe('ProjectDropdown', () => {
...
@@ -62,7 +61,7 @@ describe('ProjectDropdown', () => {
const
findSearchBox
=
()
=>
wrapper
.
findComponent
(
GlSearchBoxByType
);
const
findSearchBox
=
()
=>
wrapper
.
findComponent
(
GlSearchBoxByType
);
function
createMockApolloProvider
({
mockGetProjectsQuery
=
mockGetProjectsQuerySuccess
}
=
{})
{
function
createMockApolloProvider
({
mockGetProjectsQuery
=
mockGetProjectsQuerySuccess
}
=
{})
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
mockApollo
=
createMockApollo
([[
getProjectsQuery
,
mockGetProjectsQuery
]]);
const
mockApollo
=
createMockApollo
([[
getProjectsQuery
,
mockGetProjectsQuery
]]);
...
@@ -71,7 +70,6 @@ describe('ProjectDropdown', () => {
...
@@ -71,7 +70,6 @@ describe('ProjectDropdown', () => {
function
createComponent
({
mockApollo
,
props
,
mountFn
=
shallowMount
}
=
{})
{
function
createComponent
({
mockApollo
,
props
,
mountFn
=
shallowMount
}
=
{})
{
wrapper
=
mountFn
(
ProjectDropdown
,
{
wrapper
=
mountFn
(
ProjectDropdown
,
{
localVue
,
apolloProvider
:
mockApollo
||
createMockApolloProvider
(),
apolloProvider
:
mockApollo
||
createMockApolloProvider
(),
propsData
:
props
,
propsData
:
props
,
});
});
...
...
spec/frontend/jira_connect/branches/components/source_branch_dropdown_spec.js
View file @
54d8e51b
import
{
GlDropdown
,
GlDropdownItem
,
GlLoadingIcon
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
import
{
GlDropdown
,
GlDropdownItem
,
GlLoadingIcon
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
import
{
mount
,
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -7,8 +8,6 @@ import SourceBranchDropdown from '~/jira_connect/branches/components/source_bran
...
@@ -7,8 +8,6 @@ import SourceBranchDropdown from '~/jira_connect/branches/components/source_bran
import
{
BRANCHES_PER_PAGE
}
from
'
~/jira_connect/branches/constants
'
;
import
{
BRANCHES_PER_PAGE
}
from
'
~/jira_connect/branches/constants
'
;
import
getProjectQuery
from
'
~/jira_connect/branches/graphql/queries/get_project.query.graphql
'
;
import
getProjectQuery
from
'
~/jira_connect/branches/graphql/queries/get_project.query.graphql
'
;
const
localVue
=
createLocalVue
();
const
mockProject
=
{
const
mockProject
=
{
id
:
'
test
'
,
id
:
'
test
'
,
fullPath
:
'
test-path
'
,
fullPath
:
'
test-path
'
,
...
@@ -45,7 +44,7 @@ describe('SourceBranchDropdown', () => {
...
@@ -45,7 +44,7 @@ describe('SourceBranchDropdown', () => {
};
};
function
createMockApolloProvider
({
getProjectQueryLoading
=
false
}
=
{})
{
function
createMockApolloProvider
({
getProjectQueryLoading
=
false
}
=
{})
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
mockApollo
=
createMockApollo
([
const
mockApollo
=
createMockApollo
([
[
getProjectQuery
,
getProjectQueryLoading
?
mockQueryLoading
:
mockGetProjectQuery
],
[
getProjectQuery
,
getProjectQueryLoading
?
mockQueryLoading
:
mockGetProjectQuery
],
...
@@ -56,7 +55,6 @@ describe('SourceBranchDropdown', () => {
...
@@ -56,7 +55,6 @@ describe('SourceBranchDropdown', () => {
function
createComponent
({
mockApollo
,
props
,
mountFn
=
shallowMount
}
=
{})
{
function
createComponent
({
mockApollo
,
props
,
mountFn
=
shallowMount
}
=
{})
{
wrapper
=
mountFn
(
SourceBranchDropdown
,
{
wrapper
=
mountFn
(
SourceBranchDropdown
,
{
localVue
,
apolloProvider
:
mockApollo
||
createMockApolloProvider
(),
apolloProvider
:
mockApollo
||
createMockApolloProvider
(),
propsData
:
props
,
propsData
:
props
,
});
});
...
...
spec/frontend/jobs/bridge/app_spec.js
View file @
54d8e51b
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlBreakpointInstance
}
from
'
@gitlab/ui/dist/utils
'
;
import
{
GlBreakpointInstance
}
from
'
@gitlab/ui/dist/utils
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
...
@@ -17,9 +18,6 @@ import {
...
@@ -17,9 +18,6 @@ import {
mockPipelineQueryResponse
,
mockPipelineQueryResponse
,
}
from
'
./mock_data
'
;
}
from
'
./mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
VueApollo
);
describe
(
'
Bridge Show Page
'
,
()
=>
{
describe
(
'
Bridge Show Page
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
mockApollo
;
let
mockApollo
;
...
@@ -47,10 +45,10 @@ describe('Bridge Show Page', () => {
...
@@ -47,10 +45,10 @@ describe('Bridge Show Page', () => {
const
createComponentWithApollo
=
()
=>
{
const
createComponentWithApollo
=
()
=>
{
const
handlers
=
[[
getPipelineQuery
,
mockPipelineQuery
]];
const
handlers
=
[[
getPipelineQuery
,
mockPipelineQuery
]];
Vue
.
use
(
VueApollo
);
mockApollo
=
createMockApollo
(
handlers
);
mockApollo
=
createMockApollo
(
handlers
);
createComponent
({
createComponent
({
localVue
,
apolloProvider
:
mockApollo
,
apolloProvider
:
mockApollo
,
mocks
:
{},
mocks
:
{},
});
});
...
...
spec/frontend/jobs/components/table/job_table_app_spec.js
View file @
54d8e51b
import
{
GlSkeletonLoader
,
GlAlert
,
GlEmptyState
,
GlPagination
}
from
'
@gitlab/ui
'
;
import
{
GlSkeletonLoader
,
GlAlert
,
GlEmptyState
,
GlPagination
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -10,8 +11,7 @@ import JobsTableTabs from '~/jobs/components/table/jobs_table_tabs.vue';
...
@@ -10,8 +11,7 @@ import JobsTableTabs from '~/jobs/components/table/jobs_table_tabs.vue';
import
{
mockJobsQueryResponse
,
mockJobsQueryEmptyResponse
}
from
'
../../mock_data
'
;
import
{
mockJobsQueryResponse
,
mockJobsQueryEmptyResponse
}
from
'
../../mock_data
'
;
const
projectPath
=
'
gitlab-org/gitlab
'
;
const
projectPath
=
'
gitlab-org/gitlab
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Job table app
'
,
()
=>
{
describe
(
'
Job table app
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -50,7 +50,6 @@ describe('Job table app', () => {
...
@@ -50,7 +50,6 @@ describe('Job table app', () => {
provide
:
{
provide
:
{
projectPath
,
projectPath
,
},
},
localVue
,
apolloProvider
:
createMockApolloProvider
(
handler
),
apolloProvider
:
createMockApolloProvider
(
handler
),
});
});
};
};
...
...
spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_spec.js
View file @
54d8e51b
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
{
GlEmptyState
}
from
'
@gitlab/ui
'
;
import
{
GlEmptyState
}
from
'
@gitlab/ui
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
@@ -22,8 +22,6 @@ import {
...
@@ -22,8 +22,6 @@ import {
import
{
FILTERED_SEARCH_TERM
}
from
'
~/packages_and_registries/shared/constants
'
;
import
{
FILTERED_SEARCH_TERM
}
from
'
~/packages_and_registries/shared/constants
'
;
import
{
tagsMock
,
imageTagsMock
,
tagsPageInfo
}
from
'
../../mock_data
'
;
import
{
tagsMock
,
imageTagsMock
,
tagsPageInfo
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
describe
(
'
Tags List
'
,
()
=>
{
describe
(
'
Tags List
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
apolloProvider
;
let
apolloProvider
;
...
@@ -50,13 +48,12 @@ describe('Tags List', () => {
...
@@ -50,13 +48,12 @@ describe('Tags List', () => {
};
};
const
mountComponent
=
({
propsData
=
{
isMobile
:
false
,
id
:
1
}
}
=
{})
=>
{
const
mountComponent
=
({
propsData
=
{
isMobile
:
false
,
id
:
1
}
}
=
{})
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
requestHandlers
=
[[
getContainerRepositoryTagsQuery
,
resolver
]];
const
requestHandlers
=
[[
getContainerRepositoryTagsQuery
,
resolver
]];
apolloProvider
=
createMockApollo
(
requestHandlers
);
apolloProvider
=
createMockApollo
(
requestHandlers
);
wrapper
=
shallowMount
(
component
,
{
wrapper
=
shallowMount
(
component
,
{
localVue
,
apolloProvider
,
apolloProvider
,
propsData
,
propsData
,
stubs
:
{
RegistryList
},
stubs
:
{
RegistryList
},
...
...
spec/frontend/packages_and_registries/container_registry/explorer/pages/details_spec.js
View file @
54d8e51b
import
{
GlKeysetPagination
,
GlEmptyState
}
from
'
@gitlab/ui
'
;
import
{
GlKeysetPagination
,
GlEmptyState
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
nextTick
}
from
'
vue
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
...
@@ -39,8 +40,6 @@ import {
...
@@ -39,8 +40,6 @@ import {
}
from
'
../mock_data
'
;
}
from
'
../mock_data
'
;
import
{
DeleteModal
}
from
'
../stubs
'
;
import
{
DeleteModal
}
from
'
../stubs
'
;
const
localVue
=
createLocalVue
();
describe
(
'
Details Page
'
,
()
=>
{
describe
(
'
Details Page
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
apolloProvider
;
let
apolloProvider
;
...
@@ -85,7 +84,7 @@ describe('Details Page', () => {
...
@@ -85,7 +84,7 @@ describe('Details Page', () => {
options
,
options
,
config
=
defaultConfig
,
config
=
defaultConfig
,
}
=
{})
=>
{
}
=
{})
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
requestHandlers
=
[
const
requestHandlers
=
[
[
getContainerRepositoryDetailsQuery
,
resolver
],
[
getContainerRepositoryDetailsQuery
,
resolver
],
...
@@ -96,7 +95,6 @@ describe('Details Page', () => {
...
@@ -96,7 +95,6 @@ describe('Details Page', () => {
apolloProvider
=
createMockApollo
(
requestHandlers
);
apolloProvider
=
createMockApollo
(
requestHandlers
);
wrapper
=
shallowMount
(
component
,
{
wrapper
=
shallowMount
(
component
,
{
localVue
,
apolloProvider
,
apolloProvider
,
stubs
:
{
stubs
:
{
DeleteModal
,
DeleteModal
,
...
...
spec/frontend/packages_and_registries/container_registry/explorer/pages/list_spec.js
View file @
54d8e51b
import
{
GlSkeletonLoader
,
GlSprintf
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
GlSkeletonLoader
,
GlSprintf
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -38,8 +39,6 @@ import {
...
@@ -38,8 +39,6 @@ import {
}
from
'
../mock_data
'
;
}
from
'
../mock_data
'
;
import
{
GlModal
,
GlEmptyState
}
from
'
../stubs
'
;
import
{
GlModal
,
GlEmptyState
}
from
'
../stubs
'
;
const
localVue
=
createLocalVue
();
describe
(
'
List Page
'
,
()
=>
{
describe
(
'
List Page
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
apolloProvider
;
let
apolloProvider
;
...
@@ -75,7 +74,7 @@ describe('List Page', () => {
...
@@ -75,7 +74,7 @@ describe('List Page', () => {
config
=
{
isGroupPage
:
false
},
config
=
{
isGroupPage
:
false
},
query
=
{},
query
=
{},
}
=
{})
=>
{
}
=
{})
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
requestHandlers
=
[
const
requestHandlers
=
[
[
getContainerRepositoriesQuery
,
resolver
],
[
getContainerRepositoriesQuery
,
resolver
],
...
@@ -86,7 +85,6 @@ describe('List Page', () => {
...
@@ -86,7 +85,6 @@ describe('List Page', () => {
apolloProvider
=
createMockApollo
(
requestHandlers
);
apolloProvider
=
createMockApollo
(
requestHandlers
);
wrapper
=
shallowMount
(
component
,
{
wrapper
=
shallowMount
(
component
,
{
localVue
,
apolloProvider
,
apolloProvider
,
stubs
:
{
stubs
:
{
GlModal
,
GlModal
,
...
...
spec/frontend/packages_and_registries/dependency_proxy/app_spec.js
View file @
54d8e51b
...
@@ -5,7 +5,7 @@ import {
...
@@ -5,7 +5,7 @@ import {
GlSprintf
,
GlSprintf
,
GlEmptyState
,
GlEmptyState
,
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
...
@@ -21,8 +21,6 @@ import getDependencyProxyDetailsQuery from '~/packages_and_registries/dependency
...
@@ -21,8 +21,6 @@ import getDependencyProxyDetailsQuery from '~/packages_and_registries/dependency
import
{
proxyDetailsQuery
,
proxyData
,
pagination
,
proxyManifests
}
from
'
./mock_data
'
;
import
{
proxyDetailsQuery
,
proxyData
,
pagination
,
proxyManifests
}
from
'
./mock_data
'
;
const
localVue
=
createLocalVue
();
describe
(
'
DependencyProxyApp
'
,
()
=>
{
describe
(
'
DependencyProxyApp
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
apolloProvider
;
let
apolloProvider
;
...
@@ -35,14 +33,13 @@ describe('DependencyProxyApp', () => {
...
@@ -35,14 +33,13 @@ describe('DependencyProxyApp', () => {
};
};
function
createComponent
({
provide
=
provideDefaults
}
=
{})
{
function
createComponent
({
provide
=
provideDefaults
}
=
{})
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
requestHandlers
=
[[
getDependencyProxyDetailsQuery
,
resolver
]];
const
requestHandlers
=
[[
getDependencyProxyDetailsQuery
,
resolver
]];
apolloProvider
=
createMockApollo
(
requestHandlers
);
apolloProvider
=
createMockApollo
(
requestHandlers
);
wrapper
=
shallowMountExtended
(
DependencyProxyApp
,
{
wrapper
=
shallowMountExtended
(
DependencyProxyApp
,
{
localVue
,
apolloProvider
,
apolloProvider
,
provide
,
provide
,
stubs
:
{
stubs
:
{
...
...
spec/frontend/packages_and_registries/package_registry/components/functional/delete_package_spec.js
View file @
54d8e51b
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
...
@@ -16,8 +16,6 @@ import {
...
@@ -16,8 +16,6 @@ import {
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
const
localVue
=
createLocalVue
();
describe
(
'
DeletePackage
'
,
()
=>
{
describe
(
'
DeletePackage
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
apolloProvider
;
let
apolloProvider
;
...
@@ -27,7 +25,7 @@ describe('DeletePackage', () => {
...
@@ -27,7 +25,7 @@ describe('DeletePackage', () => {
const
eventPayload
=
{
id
:
'
1
'
};
const
eventPayload
=
{
id
:
'
1
'
};
function
createComponent
(
propsData
=
{})
{
function
createComponent
(
propsData
=
{})
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
requestHandlers
=
[
const
requestHandlers
=
[
[
getPackagesQuery
,
resolver
],
[
getPackagesQuery
,
resolver
],
...
@@ -37,7 +35,6 @@ describe('DeletePackage', () => {
...
@@ -37,7 +35,6 @@ describe('DeletePackage', () => {
wrapper
=
shallowMountExtended
(
DeletePackage
,
{
wrapper
=
shallowMountExtended
(
DeletePackage
,
{
propsData
,
propsData
,
localVue
,
apolloProvider
,
apolloProvider
,
scopedSlots
:
{
scopedSlots
:
{
default
(
props
)
{
default
(
props
)
{
...
...
spec/frontend/packages_and_registries/package_registry/pages/details_spec.js
View file @
54d8e51b
import
{
GlEmptyState
,
GlBadge
,
GlTabs
,
GlTab
}
from
'
@gitlab/ui
'
;
import
{
GlEmptyState
,
GlBadge
,
GlTabs
,
GlTab
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
{
useMockLocationHelper
}
from
'
helpers/mock_window_location_helper
'
;
import
{
useMockLocationHelper
}
from
'
helpers/mock_window_location_helper
'
;
...
@@ -41,8 +41,6 @@ import {
...
@@ -41,8 +41,6 @@ import {
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
useMockLocationHelper
();
useMockLocationHelper
();
const
localVue
=
createLocalVue
();
describe
(
'
PackagesApp
'
,
()
=>
{
describe
(
'
PackagesApp
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
apolloProvider
;
let
apolloProvider
;
...
@@ -64,7 +62,7 @@ describe('PackagesApp', () => {
...
@@ -64,7 +62,7 @@ describe('PackagesApp', () => {
fileDeleteMutationResolver
=
jest
.
fn
().
mockResolvedValue
(
packageDestroyFileMutation
()),
fileDeleteMutationResolver
=
jest
.
fn
().
mockResolvedValue
(
packageDestroyFileMutation
()),
routeId
=
'
1
'
,
routeId
=
'
1
'
,
}
=
{})
{
}
=
{})
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
requestHandlers
=
[
const
requestHandlers
=
[
[
getPackageDetails
,
resolver
],
[
getPackageDetails
,
resolver
],
...
@@ -73,7 +71,6 @@ describe('PackagesApp', () => {
...
@@ -73,7 +71,6 @@ describe('PackagesApp', () => {
apolloProvider
=
createMockApollo
(
requestHandlers
);
apolloProvider
=
createMockApollo
(
requestHandlers
);
wrapper
=
shallowMountExtended
(
PackagesApp
,
{
wrapper
=
shallowMountExtended
(
PackagesApp
,
{
localVue
,
apolloProvider
,
apolloProvider
,
provide
,
provide
,
stubs
:
{
stubs
:
{
...
...
spec/frontend/packages_and_registries/package_registry/pages/list_spec.js
View file @
54d8e51b
import
{
GlEmptyState
,
GlSprintf
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlEmptyState
,
GlSprintf
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
nextTick
}
from
'
vue
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -27,8 +27,6 @@ import { packagesListQuery, packageData, pagination } from '../mock_data';
...
@@ -27,8 +27,6 @@ import { packagesListQuery, packageData, pagination } from '../mock_data';
jest
.
mock
(
'
~/lib/utils/common_utils
'
);
jest
.
mock
(
'
~/lib/utils/common_utils
'
);
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
const
localVue
=
createLocalVue
();
describe
(
'
PackagesListApp
'
,
()
=>
{
describe
(
'
PackagesListApp
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
apolloProvider
;
let
apolloProvider
;
...
@@ -61,13 +59,12 @@ describe('PackagesListApp', () => {
...
@@ -61,13 +59,12 @@ describe('PackagesListApp', () => {
resolver
=
jest
.
fn
().
mockResolvedValue
(
packagesListQuery
()),
resolver
=
jest
.
fn
().
mockResolvedValue
(
packagesListQuery
()),
provide
=
defaultProvide
,
provide
=
defaultProvide
,
}
=
{})
=>
{
}
=
{})
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
requestHandlers
=
[[
getPackagesQuery
,
resolver
]];
const
requestHandlers
=
[[
getPackagesQuery
,
resolver
]];
apolloProvider
=
createMockApollo
(
requestHandlers
);
apolloProvider
=
createMockApollo
(
requestHandlers
);
wrapper
=
shallowMountExtended
(
ListPage
,
{
wrapper
=
shallowMountExtended
(
ListPage
,
{
localVue
,
apolloProvider
,
apolloProvider
,
provide
,
provide
,
stubs
:
{
stubs
:
{
...
...
spec/frontend/packages_and_registries/settings/group/components/dependency_proxy_settings_spec.js
View file @
54d8e51b
import
{
GlSprintf
,
GlToggle
}
from
'
@gitlab/ui
'
;
import
{
GlSprintf
,
GlToggle
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
@@ -33,8 +33,6 @@ import {
...
@@ -33,8 +33,6 @@ import {
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/packages_and_registries/settings/group/graphql/utils/optimistic_responses
'
);
jest
.
mock
(
'
~/packages_and_registries/settings/group/graphql/utils/optimistic_responses
'
);
const
localVue
=
createLocalVue
();
describe
(
'
DependencyProxySettings
'
,
()
=>
{
describe
(
'
DependencyProxySettings
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
apolloProvider
;
let
apolloProvider
;
...
@@ -47,7 +45,7 @@ describe('DependencyProxySettings', () => {
...
@@ -47,7 +45,7 @@ describe('DependencyProxySettings', () => {
groupDependencyProxyPath
:
'
group_dependency_proxy_path
'
,
groupDependencyProxyPath
:
'
group_dependency_proxy_path
'
,
};
};
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
mountComponent
=
({
const
mountComponent
=
({
provide
=
defaultProvide
,
provide
=
defaultProvide
,
...
@@ -63,7 +61,6 @@ describe('DependencyProxySettings', () => {
...
@@ -63,7 +61,6 @@ describe('DependencyProxySettings', () => {
apolloProvider
=
createMockApollo
(
requestHandlers
);
apolloProvider
=
createMockApollo
(
requestHandlers
);
wrapper
=
shallowMountExtended
(
component
,
{
wrapper
=
shallowMountExtended
(
component
,
{
localVue
,
apolloProvider
,
apolloProvider
,
provide
,
provide
,
propsData
:
{
propsData
:
{
...
...
spec/frontend/packages_and_registries/settings/group/components/group_settings_app_spec.js
View file @
54d8e51b
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
nextTick
}
from
'
vue
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
PackagesSettings
from
'
~/packages_and_registries/settings/group/components/packages_settings.vue
'
;
import
PackagesSettings
from
'
~/packages_and_registries/settings/group/components/packages_settings.vue
'
;
...
@@ -19,8 +20,6 @@ import {
...
@@ -19,8 +20,6 @@ import {
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
const
localVue
=
createLocalVue
();
describe
(
'
Group Settings App
'
,
()
=>
{
describe
(
'
Group Settings App
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
apolloProvider
;
let
apolloProvider
;
...
@@ -36,14 +35,13 @@ describe('Group Settings App', () => {
...
@@ -36,14 +35,13 @@ describe('Group Settings App', () => {
resolver
=
jest
.
fn
().
mockResolvedValue
(
groupPackageSettingsMock
),
resolver
=
jest
.
fn
().
mockResolvedValue
(
groupPackageSettingsMock
),
provide
=
defaultProvide
,
provide
=
defaultProvide
,
}
=
{})
=>
{
}
=
{})
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
requestHandlers
=
[[
getGroupPackagesSettingsQuery
,
resolver
]];
const
requestHandlers
=
[[
getGroupPackagesSettingsQuery
,
resolver
]];
apolloProvider
=
createMockApollo
(
requestHandlers
);
apolloProvider
=
createMockApollo
(
requestHandlers
);
wrapper
=
shallowMount
(
component
,
{
wrapper
=
shallowMount
(
component
,
{
localVue
,
apolloProvider
,
apolloProvider
,
provide
,
provide
,
mocks
:
{
mocks
:
{
...
...
spec/frontend/packages_and_registries/settings/group/components/package_settings_spec.js
View file @
54d8e51b
import
{
GlSprintf
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlSprintf
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
@@ -28,8 +28,6 @@ import {
...
@@ -28,8 +28,6 @@ import {
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/packages_and_registries/settings/group/graphql/utils/optimistic_responses
'
);
jest
.
mock
(
'
~/packages_and_registries/settings/group/graphql/utils/optimistic_responses
'
);
const
localVue
=
createLocalVue
();
describe
(
'
Packages Settings
'
,
()
=>
{
describe
(
'
Packages Settings
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
apolloProvider
;
let
apolloProvider
;
...
@@ -42,14 +40,13 @@ describe('Packages Settings', () => {
...
@@ -42,14 +40,13 @@ describe('Packages Settings', () => {
const
mountComponent
=
({
const
mountComponent
=
({
mutationResolver
=
jest
.
fn
().
mockResolvedValue
(
groupPackageSettingsMutationMock
()),
mutationResolver
=
jest
.
fn
().
mockResolvedValue
(
groupPackageSettingsMutationMock
()),
}
=
{})
=>
{
}
=
{})
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
requestHandlers
=
[[
updateNamespacePackageSettings
,
mutationResolver
]];
const
requestHandlers
=
[[
updateNamespacePackageSettings
,
mutationResolver
]];
apolloProvider
=
createMockApollo
(
requestHandlers
);
apolloProvider
=
createMockApollo
(
requestHandlers
);
wrapper
=
shallowMountExtended
(
component
,
{
wrapper
=
shallowMountExtended
(
component
,
{
localVue
,
apolloProvider
,
apolloProvider
,
provide
:
defaultProvide
,
provide
:
defaultProvide
,
propsData
:
{
propsData
:
{
...
...
spec/frontend/packages_and_registries/settings/project/settings/components/registry_settings_app_spec.js
View file @
54d8e51b
import
{
GlAlert
,
GlSprintf
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlAlert
,
GlSprintf
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -20,8 +21,6 @@ import {
...
@@ -20,8 +21,6 @@ import {
containerExpirationPolicyData
,
containerExpirationPolicyData
,
}
from
'
../mock_data
'
;
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
describe
(
'
Registry Settings App
'
,
()
=>
{
describe
(
'
Registry Settings App
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
fakeApollo
;
let
fakeApollo
;
...
@@ -56,13 +55,12 @@ describe('Registry Settings App', () => {
...
@@ -56,13 +55,12 @@ describe('Registry Settings App', () => {
};
};
const
mountComponentWithApollo
=
({
provide
=
defaultProvidedValues
,
resolver
}
=
{})
=>
{
const
mountComponentWithApollo
=
({
provide
=
defaultProvidedValues
,
resolver
}
=
{})
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
requestHandlers
=
[[
expirationPolicyQuery
,
resolver
]];
const
requestHandlers
=
[[
expirationPolicyQuery
,
resolver
]];
fakeApollo
=
createMockApollo
(
requestHandlers
);
fakeApollo
=
createMockApollo
(
requestHandlers
);
mountComponent
(
provide
,
{
mountComponent
(
provide
,
{
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
});
});
};
};
...
...
spec/frontend/pipeline_editor/components/header/pipeline_status_spec.js
View file @
54d8e51b
import
{
GlIcon
,
GlLink
,
GlLoadingIcon
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
,
GlLink
,
GlLoadingIcon
,
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -8,8 +9,7 @@ import getPipelineQuery from '~/pipeline_editor/graphql/queries/pipeline.query.g
...
@@ -8,8 +9,7 @@ import getPipelineQuery from '~/pipeline_editor/graphql/queries/pipeline.query.g
import
PipelineEditorMiniGraph
from
'
~/pipeline_editor/components/header/pipeline_editor_mini_graph.vue
'
;
import
PipelineEditorMiniGraph
from
'
~/pipeline_editor/components/header/pipeline_editor_mini_graph.vue
'
;
import
{
mockCommitSha
,
mockProjectPipeline
,
mockProjectFullPath
}
from
'
../../mock_data
'
;
import
{
mockCommitSha
,
mockProjectPipeline
,
mockProjectFullPath
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Pipeline Status
'
,
()
=>
{
describe
(
'
Pipeline Status
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -21,7 +21,6 @@ describe('Pipeline Status', () => {
...
@@ -21,7 +21,6 @@ describe('Pipeline Status', () => {
mockApollo
=
createMockApollo
(
handlers
);
mockApollo
=
createMockApollo
(
handlers
);
wrapper
=
shallowMount
(
PipelineStatus
,
{
wrapper
=
shallowMount
(
PipelineStatus
,
{
localVue
,
apolloProvider
:
mockApollo
,
apolloProvider
:
mockApollo
,
propsData
:
{
propsData
:
{
commitSha
:
mockCommitSha
,
commitSha
:
mockCommitSha
,
...
...
spec/frontend/pipeline_editor/components/header/pipline_editor_mini_graph_spec.js
View file @
54d8e51b
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -8,8 +9,7 @@ import getLinkedPipelinesQuery from '~/projects/commit_box/info/graphql/queries/
...
@@ -8,8 +9,7 @@ import getLinkedPipelinesQuery from '~/projects/commit_box/info/graphql/queries/
import
{
PIPELINE_FAILURE
}
from
'
~/pipeline_editor/constants
'
;
import
{
PIPELINE_FAILURE
}
from
'
~/pipeline_editor/constants
'
;
import
{
mockLinkedPipelines
,
mockProjectFullPath
,
mockProjectPipeline
}
from
'
../../mock_data
'
;
import
{
mockLinkedPipelines
,
mockProjectFullPath
,
mockProjectPipeline
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Pipeline Status
'
,
()
=>
{
describe
(
'
Pipeline Status
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -36,7 +36,6 @@ describe('Pipeline Status', () => {
...
@@ -36,7 +36,6 @@ describe('Pipeline Status', () => {
createComponent
({
createComponent
({
hasStages
,
hasStages
,
options
:
{
options
:
{
localVue
,
apolloProvider
:
mockApollo
,
apolloProvider
:
mockApollo
,
},
},
});
});
...
...
spec/frontend/pipeline_editor/components/header/validation_segment_spec.js
View file @
54d8e51b
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
{
escape
}
from
'
lodash
'
;
import
{
escape
}
from
'
lodash
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
@@ -24,8 +25,7 @@ import {
...
@@ -24,8 +25,7 @@ import {
mockYmlHelpPagePath
,
mockYmlHelpPagePath
,
}
from
'
../../mock_data
'
;
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Validation segment component
'
,
()
=>
{
describe
(
'
Validation segment component
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -45,7 +45,6 @@ describe('Validation segment component', () => {
...
@@ -45,7 +45,6 @@ describe('Validation segment component', () => {
wrapper
=
extendedWrapper
(
wrapper
=
extendedWrapper
(
shallowMount
(
ValidationSegment
,
{
shallowMount
(
ValidationSegment
,
{
localVue
,
apolloProvider
:
mockApollo
,
apolloProvider
:
mockApollo
,
provide
:
{
provide
:
{
ymlHelpPagePath
:
mockYmlHelpPagePath
,
ymlHelpPagePath
:
mockYmlHelpPagePath
,
...
...
spec/frontend/pipelines/components/jobs/jobs_app_spec.js
View file @
54d8e51b
import
{
GlIntersectionObserver
,
GlSkeletonLoader
}
from
'
@gitlab/ui
'
;
import
{
GlIntersectionObserver
,
GlSkeletonLoader
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -9,8 +10,7 @@ import JobsTable from '~/jobs/components/table/jobs_table.vue';
...
@@ -9,8 +10,7 @@ import JobsTable from '~/jobs/components/table/jobs_table.vue';
import
getPipelineJobsQuery
from
'
~/pipelines/graphql/queries/get_pipeline_jobs.query.graphql
'
;
import
getPipelineJobsQuery
from
'
~/pipelines/graphql/queries/get_pipeline_jobs.query.graphql
'
;
import
{
mockPipelineJobsQueryResponse
}
from
'
../../mock_data
'
;
import
{
mockPipelineJobsQueryResponse
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
...
@@ -36,7 +36,6 @@ describe('Jobs app', () => {
...
@@ -36,7 +36,6 @@ describe('Jobs app', () => {
fullPath
:
'
root/ci-project
'
,
fullPath
:
'
root/ci-project
'
,
pipelineIid
:
1
,
pipelineIid
:
1
,
},
},
localVue
,
apolloProvider
:
createMockApolloProvider
(
resolver
),
apolloProvider
:
createMockApolloProvider
(
resolver
),
});
});
};
};
...
...
spec/frontend/pipelines/graph/linked_pipelines_column_spec.js
View file @
54d8e51b
import
{
mount
,
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -41,13 +42,11 @@ describe('Linked Pipelines Column', () => {
...
@@ -41,13 +42,11 @@ describe('Linked Pipelines Column', () => {
const
findPipelineGraph
=
()
=>
wrapper
.
find
(
PipelineGraph
);
const
findPipelineGraph
=
()
=>
wrapper
.
find
(
PipelineGraph
);
const
findExpandButton
=
()
=>
wrapper
.
find
(
'
[data-testid="expand-pipeline-button"]
'
);
const
findExpandButton
=
()
=>
wrapper
.
find
(
'
[data-testid="expand-pipeline-button"]
'
);
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
createComponent
=
({
apolloProvider
,
mountFn
=
shallowMount
,
props
=
{}
}
=
{})
=>
{
const
createComponent
=
({
apolloProvider
,
mountFn
=
shallowMount
,
props
=
{}
}
=
{})
=>
{
wrapper
=
mountFn
(
LinkedPipelinesColumn
,
{
wrapper
=
mountFn
(
LinkedPipelinesColumn
,
{
apolloProvider
,
apolloProvider
,
localVue
,
propsData
:
{
propsData
:
{
...
defaultProps
,
...
defaultProps
,
...
props
,
...
props
,
...
...
spec/frontend/projects/pipelines/charts/components/pipeline_charts_spec.js
View file @
54d8e51b
import
{
GlColumnChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
GlColumnChart
}
from
'
@gitlab/ui/dist/charts
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -11,8 +12,7 @@ import CiCdAnalyticsCharts from '~/vue_shared/components/ci_cd_analytics/ci_cd_a
...
@@ -11,8 +12,7 @@ import CiCdAnalyticsCharts from '~/vue_shared/components/ci_cd_analytics/ci_cd_a
import
{
mockPipelineCount
,
mockPipelineStatistics
}
from
'
../mock_data
'
;
import
{
mockPipelineCount
,
mockPipelineStatistics
}
from
'
../mock_data
'
;
const
projectPath
=
'
gitlab-org/gitlab
'
;
const
projectPath
=
'
gitlab-org/gitlab
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
~/projects/pipelines/charts/components/pipeline_charts.vue
'
,
()
=>
{
describe
(
'
~/projects/pipelines/charts/components/pipeline_charts.vue
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -31,7 +31,6 @@ describe('~/projects/pipelines/charts/components/pipeline_charts.vue', () => {
...
@@ -31,7 +31,6 @@ describe('~/projects/pipelines/charts/components/pipeline_charts.vue', () => {
provide
:
{
provide
:
{
projectPath
,
projectPath
,
},
},
localVue
,
apolloProvider
:
createMockApolloProvider
(),
apolloProvider
:
createMockApolloProvider
(),
});
});
...
...
spec/frontend/repository/components/blob_content_viewer_spec.js
View file @
54d8e51b
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
mount
,
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
axios
from
'
axios
'
;
import
axios
from
'
axios
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -36,11 +37,10 @@ jest.mock('~/lib/utils/common_utils');
...
@@ -36,11 +37,10 @@ jest.mock('~/lib/utils/common_utils');
let
wrapper
;
let
wrapper
;
let
mockResolver
;
let
mockResolver
;
const
localVue
=
createLocalVue
();
const
mockAxios
=
new
MockAdapter
(
axios
);
const
mockAxios
=
new
MockAdapter
(
axios
);
const
createComponent
=
async
(
mockData
=
{},
mountFn
=
shallowMount
)
=>
{
const
createComponent
=
async
(
mockData
=
{},
mountFn
=
shallowMount
)
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
{
const
{
blob
=
simpleViewerMock
,
blob
=
simpleViewerMock
,
...
@@ -75,7 +75,6 @@ const createComponent = async (mockData = {}, mountFn = shallowMount) => {
...
@@ -75,7 +75,6 @@ const createComponent = async (mockData = {}, mountFn = shallowMount) => {
wrapper
=
extendedWrapper
(
wrapper
=
extendedWrapper
(
mountFn
(
BlobContentViewer
,
{
mountFn
(
BlobContentViewer
,
{
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
propsData
:
propsMock
,
propsData
:
propsMock
,
mixins
:
[{
data
:
()
=>
({
ref
:
refMock
})
}],
mixins
:
[{
data
:
()
=>
({
ref
:
refMock
})
}],
...
...
spec/frontend/repository/components/blob_controls_spec.js
View file @
54d8e51b
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
nextTick
}
from
'
vue
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
BlobControls
from
'
~/repository/components/blob_controls.vue
'
;
import
BlobControls
from
'
~/repository/components/blob_controls.vue
'
;
...
@@ -16,10 +16,8 @@ let router;
...
@@ -16,10 +16,8 @@ let router;
let
wrapper
;
let
wrapper
;
let
mockResolver
;
let
mockResolver
;
const
localVue
=
createLocalVue
();
const
createComponent
=
async
()
=>
{
const
createComponent
=
async
()
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
const
project
=
{
...
blobControlsDataMock
};
const
project
=
{
...
blobControlsDataMock
};
const
projectPath
=
'
some/project
'
;
const
projectPath
=
'
some/project
'
;
...
@@ -31,7 +29,6 @@ const createComponent = async () => {
...
@@ -31,7 +29,6 @@ const createComponent = async () => {
mockResolver
=
jest
.
fn
().
mockResolvedValue
({
data
:
{
project
}
});
mockResolver
=
jest
.
fn
().
mockResolvedValue
({
data
:
{
project
}
});
wrapper
=
shallowMountExtended
(
BlobControls
,
{
wrapper
=
shallowMountExtended
(
BlobControls
,
{
localVue
,
router
,
router
,
apolloProvider
:
createMockApollo
([[
blobControlsQuery
,
mockResolver
]]),
apolloProvider
:
createMockApollo
([[
blobControlsQuery
,
mockResolver
]]),
propsData
:
{
projectPath
},
propsData
:
{
projectPath
},
...
...
spec/frontend/runner/admin_runner_edit/admin_runner_edit_app_spec.js
View file @
54d8e51b
import
{
createLocalVue
,
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
mount
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -18,8 +19,7 @@ jest.mock('~/runner/sentry_utils');
...
@@ -18,8 +19,7 @@ jest.mock('~/runner/sentry_utils');
const
mockRunnerGraphqlId
=
runnerData
.
data
.
runner
.
id
;
const
mockRunnerGraphqlId
=
runnerData
.
data
.
runner
.
id
;
const
mockRunnerId
=
`
${
getIdFromGraphQLId
(
mockRunnerGraphqlId
)}
`
;
const
mockRunnerId
=
`
${
getIdFromGraphQLId
(
mockRunnerGraphqlId
)}
`
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
AdminRunnerEditApp
'
,
()
=>
{
describe
(
'
AdminRunnerEditApp
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -29,7 +29,6 @@ describe('AdminRunnerEditApp', () => {
...
@@ -29,7 +29,6 @@ describe('AdminRunnerEditApp', () => {
const
createComponentWithApollo
=
({
props
=
{},
mountFn
=
shallowMount
}
=
{})
=>
{
const
createComponentWithApollo
=
({
props
=
{},
mountFn
=
shallowMount
}
=
{})
=>
{
wrapper
=
mountFn
(
AdminRunnerEditApp
,
{
wrapper
=
mountFn
(
AdminRunnerEditApp
,
{
localVue
,
apolloProvider
:
createMockApollo
([[
getRunnerQuery
,
mockRunnerQuery
]]),
apolloProvider
:
createMockApollo
([[
getRunnerQuery
,
mockRunnerQuery
]]),
propsData
:
{
propsData
:
{
runnerId
:
mockRunnerId
,
runnerId
:
mockRunnerId
,
...
...
spec/frontend/runner/components/registration/registration_dropdown_spec.js
View file @
54d8e51b
import
{
GlDropdown
,
GlDropdownItem
,
GlDropdownForm
}
from
'
@gitlab/ui
'
;
import
{
GlDropdown
,
GlDropdownItem
,
GlDropdownForm
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
createWrapper
}
from
'
@vue/test-utils
'
;
import
{
mount
,
shallowMount
,
createWrapper
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
shallowMountExtended
,
mountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
RegistrationDropdown
from
'
~/runner/components/registration/registration_dropdown.vue
'
;
import
RegistrationDropdown
from
'
~/runner/components/registration/registration_dropdown.vue
'
;
...
@@ -33,15 +34,17 @@ describe('RegistrationDropdown', () => {
...
@@ -33,15 +34,17 @@ describe('RegistrationDropdown', () => {
const
findToggleMaskButton
=
()
=>
wrapper
.
findByTestId
(
'
toggle-masked
'
);
const
findToggleMaskButton
=
()
=>
wrapper
.
findByTestId
(
'
toggle-masked
'
);
const
createComponent
=
({
props
=
{},
...
options
}
=
{},
mountFn
=
shallowMountExtended
)
=>
{
const
createComponent
=
({
props
=
{},
...
options
}
=
{},
mountFn
=
shallowMount
)
=>
{
wrapper
=
mountFn
(
RegistrationDropdown
,
{
wrapper
=
extendedWrapper
(
mountFn
(
RegistrationDropdown
,
{
propsData
:
{
propsData
:
{
registrationToken
:
mockToken
,
registrationToken
:
mockToken
,
type
:
INSTANCE_TYPE
,
type
:
INSTANCE_TYPE
,
...
props
,
...
props
,
},
},
...
options
,
...
options
,
});
}),
);
};
};
it
.
each
`
it
.
each
`
...
@@ -50,7 +53,7 @@ describe('RegistrationDropdown', () => {
...
@@ -50,7 +53,7 @@ describe('RegistrationDropdown', () => {
${
GROUP_TYPE
}
|
${
'
Register a group runner
'
}
${
GROUP_TYPE
}
|
${
'
Register a group runner
'
}
${
PROJECT_TYPE
}
|
${
'
Register a project runner
'
}
${
PROJECT_TYPE
}
|
${
'
Register a project runner
'
}
`
(
'
Dropdown text for type $type is "$text"
'
,
()
=>
{
`
(
'
Dropdown text for type $type is "$text"
'
,
()
=>
{
createComponent
({
props
:
{
type
:
INSTANCE_TYPE
}
},
mount
Extended
);
createComponent
({
props
:
{
type
:
INSTANCE_TYPE
}
},
mount
);
expect
(
wrapper
.
text
()).
toContain
(
'
Register an instance runner
'
);
expect
(
wrapper
.
text
()).
toContain
(
'
Register an instance runner
'
);
});
});
...
@@ -71,8 +74,7 @@ describe('RegistrationDropdown', () => {
...
@@ -71,8 +74,7 @@ describe('RegistrationDropdown', () => {
});
});
describe
(
'
When the dropdown item is clicked
'
,
()
=>
{
describe
(
'
When the dropdown item is clicked
'
,
()
=>
{
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
requestHandlers
=
[
const
requestHandlers
=
[
[
getRunnerPlatformsQuery
,
jest
.
fn
().
mockResolvedValue
(
mockGraphqlRunnerPlatforms
)],
[
getRunnerPlatformsQuery
,
jest
.
fn
().
mockResolvedValue
(
mockGraphqlRunnerPlatforms
)],
...
@@ -85,13 +87,12 @@ describe('RegistrationDropdown', () => {
...
@@ -85,13 +87,12 @@ describe('RegistrationDropdown', () => {
beforeEach
(
async
()
=>
{
beforeEach
(
async
()
=>
{
createComponent
(
createComponent
(
{
{
localVue
,
// Mock load modal contents from API
// Mock load modal contents from API
apolloProvider
:
createMockApollo
(
requestHandlers
),
apolloProvider
:
createMockApollo
(
requestHandlers
),
// Use `attachTo` to find the modal
// Use `attachTo` to find the modal
attachTo
:
document
.
body
,
attachTo
:
document
.
body
,
},
},
mount
Extended
,
mount
,
);
);
await
findRegistrationInstructionsDropdownItem
().
trigger
(
'
click
'
);
await
findRegistrationInstructionsDropdownItem
().
trigger
(
'
click
'
);
...
@@ -129,7 +130,7 @@ describe('RegistrationDropdown', () => {
...
@@ -129,7 +130,7 @@ describe('RegistrationDropdown', () => {
});
});
it
(
'
Displays masked value by default
'
,
()
=>
{
it
(
'
Displays masked value by default
'
,
()
=>
{
createComponent
({},
mount
Extended
);
createComponent
({},
mount
);
expect
(
findTokenDropdownItem
().
text
()).
toMatchInterpolatedText
(
expect
(
findTokenDropdownItem
().
text
()).
toMatchInterpolatedText
(
`Registration token
${
maskToken
}
`
,
`Registration token
${
maskToken
}
`
,
...
@@ -152,7 +153,7 @@ describe('RegistrationDropdown', () => {
...
@@ -152,7 +153,7 @@ describe('RegistrationDropdown', () => {
});
});
it
(
'
Updates the token when it gets reset
'
,
async
()
=>
{
it
(
'
Updates the token when it gets reset
'
,
async
()
=>
{
createComponent
({},
mount
Extended
);
createComponent
({},
mount
);
const
newToken
=
'
mock1
'
;
const
newToken
=
'
mock1
'
;
...
...
spec/frontend/runner/components/registration/registration_token_reset_dropdown_item_spec.js
View file @
54d8e51b
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
{
GlDropdownItem
,
GlLoadingIcon
,
GlToast
,
GlModal
}
from
'
@gitlab/ui
'
;
import
{
GlDropdownItem
,
GlLoadingIcon
,
GlToast
,
GlModal
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
createAlert
}
from
'
~/flash
'
;
import
{
createAlert
}
from
'
~/flash
'
;
...
@@ -32,7 +33,7 @@ describe('RegistrationTokenResetDropdownItem', () => {
...
@@ -32,7 +33,7 @@ describe('RegistrationTokenResetDropdownItem', () => {
const
clickSubmit
=
()
=>
findModal
().
vm
.
$emit
(
'
primary
'
,
mockEvent
);
const
clickSubmit
=
()
=>
findModal
().
vm
.
$emit
(
'
primary
'
,
mockEvent
);
const
createComponent
=
({
props
,
provide
=
{}
}
=
{})
=>
{
const
createComponent
=
({
props
,
provide
=
{}
}
=
{})
=>
{
wrapper
=
shallowMount
Extended
(
RegistrationTokenResetDropdownItem
,
{
wrapper
=
shallowMount
(
RegistrationTokenResetDropdownItem
,
{
provide
,
provide
,
propsData
:
{
propsData
:
{
type
:
INSTANCE_TYPE
,
type
:
INSTANCE_TYPE
,
...
...
spec/frontend/runner/group_runners/group_runners_app_spec.js
View file @
54d8e51b
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
GlLink
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
mount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
,
mount
}
from
'
@vue/test-utils
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
setWindowLocation
from
'
helpers/set_window_location_helper
'
;
import
setWindowLocation
from
'
helpers/set_window_location_helper
'
;
...
...
spec/frontend/sidebar/assignees_realtime_spec.js
View file @
54d8e51b
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
AssigneesRealtime
from
'
~/sidebar/components/assignees/assignees_realtime.vue
'
;
import
AssigneesRealtime
from
'
~/sidebar/components/assignees/assignees_realtime.vue
'
;
...
@@ -7,8 +8,7 @@ import SidebarMediator from '~/sidebar/sidebar_mediator';
...
@@ -7,8 +8,7 @@ import SidebarMediator from '~/sidebar/sidebar_mediator';
import
getIssueAssigneesQuery
from
'
~/vue_shared/components/sidebar/queries/get_issue_assignees.query.graphql
'
;
import
getIssueAssigneesQuery
from
'
~/vue_shared/components/sidebar/queries/get_issue_assignees.query.graphql
'
;
import
Mock
,
{
issuableQueryResponse
,
subscriptionNullResponse
}
from
'
./mock_data
'
;
import
Mock
,
{
issuableQueryResponse
,
subscriptionNullResponse
}
from
'
./mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Assignees Realtime
'
,
()
=>
{
describe
(
'
Assignees Realtime
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -38,7 +38,6 @@ describe('Assignees Realtime', () => {
...
@@ -38,7 +38,6 @@ describe('Assignees Realtime', () => {
mediator
,
mediator
,
},
},
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
localVue
,
});
});
};
};
...
...
spec/frontend/sidebar/components/assignees/sidebar_assignees_widget_spec.js
View file @
54d8e51b
import
{
GlSearchBoxByType
,
GlDropdown
}
from
'
@gitlab/ui
'
;
import
{
GlSearchBoxByType
,
GlDropdown
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -23,8 +24,7 @@ const updateIssueAssigneesMutationSuccess = jest
...
@@ -23,8 +24,7 @@ const updateIssueAssigneesMutationSuccess = jest
.
mockResolvedValue
(
updateIssueAssigneesMutationResponse
);
.
mockResolvedValue
(
updateIssueAssigneesMutationResponse
);
const
mockError
=
jest
.
fn
().
mockRejectedValue
(
'
Error!
'
);
const
mockError
=
jest
.
fn
().
mockRejectedValue
(
'
Error!
'
);
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
const
initialAssignees
=
[
const
initialAssignees
=
[
{
{
...
@@ -59,7 +59,6 @@ describe('Sidebar assignees widget', () => {
...
@@ -59,7 +59,6 @@ describe('Sidebar assignees widget', () => {
[
updateIssueAssigneesMutation
,
updateIssueAssigneesMutationHandler
],
[
updateIssueAssigneesMutation
,
updateIssueAssigneesMutationHandler
],
]);
]);
wrapper
=
shallowMount
(
SidebarAssigneesWidget
,
{
wrapper
=
shallowMount
(
SidebarAssigneesWidget
,
{
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
propsData
:
{
propsData
:
{
iid
:
'
1
'
,
iid
:
'
1
'
,
...
...
spec/frontend/sidebar/components/confidential/sidebar_confidentiality_widget_spec.js
View file @
54d8e51b
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -15,8 +16,7 @@ import { issueConfidentialityResponse } from '../../mock_data';
...
@@ -15,8 +16,7 @@ import { issueConfidentialityResponse } from '../../mock_data';
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Sidebar Confidentiality Widget
'
,
()
=>
{
describe
(
'
Sidebar Confidentiality Widget
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -32,7 +32,6 @@ describe('Sidebar Confidentiality Widget', () => {
...
@@ -32,7 +32,6 @@ describe('Sidebar Confidentiality Widget', () => {
fakeApollo
=
createMockApollo
([[
issueConfidentialQuery
,
confidentialQueryHandler
]]);
fakeApollo
=
createMockApollo
([[
issueConfidentialQuery
,
confidentialQueryHandler
]]);
wrapper
=
shallowMount
(
SidebarConfidentialityWidget
,
{
wrapper
=
shallowMount
(
SidebarConfidentialityWidget
,
{
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
provide
:
{
provide
:
{
canUpdate
:
true
,
canUpdate
:
true
,
...
...
spec/frontend/sidebar/components/sidebar_dropdown_widget_spec.js
View file @
54d8e51b
...
@@ -8,7 +8,8 @@ import {
...
@@ -8,7 +8,8 @@ import {
GlLoadingIcon
,
GlLoadingIcon
,
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
*
as
Sentry
from
'
@sentry/browser
'
;
import
{
createLocalVue
,
shallowMount
,
mount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
,
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
@@ -37,8 +38,6 @@ import {
...
@@ -37,8 +38,6 @@ import {
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
const
localVue
=
createLocalVue
();
describe
(
'
SidebarDropdownWidget
'
,
()
=>
{
describe
(
'
SidebarDropdownWidget
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
mockApollo
;
let
mockApollo
;
...
@@ -108,7 +107,7 @@ describe('SidebarDropdownWidget', () => {
...
@@ -108,7 +107,7 @@ describe('SidebarDropdownWidget', () => {
projectMilestonesSpy
=
jest
.
fn
().
mockResolvedValue
(
mockProjectMilestonesResponse
),
projectMilestonesSpy
=
jest
.
fn
().
mockResolvedValue
(
mockProjectMilestonesResponse
),
currentMilestoneSpy
=
jest
.
fn
().
mockResolvedValue
(
noCurrentMilestoneResponse
),
currentMilestoneSpy
=
jest
.
fn
().
mockResolvedValue
(
noCurrentMilestoneResponse
),
}
=
{})
=>
{
}
=
{})
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
mockApollo
=
createMockApollo
([
mockApollo
=
createMockApollo
([
[
projectMilestonesQuery
,
projectMilestonesSpy
],
[
projectMilestonesQuery
,
projectMilestonesSpy
],
[
projectIssueMilestoneQuery
,
currentMilestoneSpy
],
[
projectIssueMilestoneQuery
,
currentMilestoneSpy
],
...
@@ -117,7 +116,6 @@ describe('SidebarDropdownWidget', () => {
...
@@ -117,7 +116,6 @@ describe('SidebarDropdownWidget', () => {
wrapper
=
extendedWrapper
(
wrapper
=
extendedWrapper
(
mount
(
SidebarDropdownWidget
,
{
mount
(
SidebarDropdownWidget
,
{
localVue
,
provide
:
{
canUpdate
:
true
},
provide
:
{
canUpdate
:
true
},
apolloProvider
:
mockApollo
,
apolloProvider
:
mockApollo
,
propsData
:
{
propsData
:
{
...
...
spec/frontend/sidebar/components/time_tracking/report_spec.js
View file @
54d8e51b
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
getAllByRole
,
getByRole
}
from
'
@testing-library/dom
'
;
import
{
getAllByRole
,
getByRole
}
from
'
@testing-library/dom
'
;
import
{
shallowMount
,
createLocalVue
,
mount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
,
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
@@ -13,8 +14,7 @@ import { getIssueTimelogsQueryResponse, getMrTimelogsQueryResponse } from './moc
...
@@ -13,8 +14,7 @@ import { getIssueTimelogsQueryResponse, getMrTimelogsQueryResponse } from './moc
jest
.
mock
(
'
~/flash
'
);
jest
.
mock
(
'
~/flash
'
);
describe
(
'
Issuable Time Tracking Report
'
,
()
=>
{
describe
(
'
Issuable Time Tracking Report
'
,
()
=>
{
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
let
wrapper
;
let
wrapper
;
let
fakeApollo
;
let
fakeApollo
;
const
findLoadingIcon
=
()
=>
wrapper
.
findComponent
(
GlLoadingIcon
);
const
findLoadingIcon
=
()
=>
wrapper
.
findComponent
(
GlLoadingIcon
);
...
@@ -37,7 +37,6 @@ describe('Issuable Time Tracking Report', () => {
...
@@ -37,7 +37,6 @@ describe('Issuable Time Tracking Report', () => {
issuableType
,
issuableType
,
},
},
propsData
:
{
limitToHours
,
issuableId
:
'
1
'
},
propsData
:
{
limitToHours
,
issuableId
:
'
1
'
},
localVue
,
apolloProvider
:
fakeApollo
,
apolloProvider
:
fakeApollo
,
});
});
};
};
...
...
spec/frontend/snippets/components/edit_spec.js
View file @
54d8e51b
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
{
merge
}
from
'
lodash
'
;
import
{
merge
}
from
'
lodash
'
;
import
{
nextTick
}
from
'
vue
'
;
import
VueApollo
,
{
ApolloMutation
}
from
'
vue-apollo
'
;
import
VueApollo
,
{
ApolloMutation
}
from
'
vue-apollo
'
;
import
{
useFakeDate
}
from
'
helpers/fake_date
'
;
import
{
useFakeDate
}
from
'
helpers/fake_date
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
@@ -78,8 +79,7 @@ const getApiData = ({
...
@@ -78,8 +79,7 @@ const getApiData = ({
blobActions
:
[],
blobActions
:
[],
});
});
const
localVue
=
createLocalVue
();
Vue
.
use
(
VueApollo
);
localVue
.
use
(
VueApollo
);
describe
(
'
Snippet Edit app
'
,
()
=>
{
describe
(
'
Snippet Edit app
'
,
()
=>
{
useFakeDate
();
useFakeDate
();
...
@@ -141,7 +141,6 @@ describe('Snippet Edit app', () => {
...
@@ -141,7 +141,6 @@ describe('Snippet Edit app', () => {
wrapper
=
shallowMount
(
SnippetEditApp
,
{
wrapper
=
shallowMount
(
SnippetEditApp
,
{
apolloProvider
,
apolloProvider
,
localVue
,
stubs
:
{
stubs
:
{
ApolloMutation
,
ApolloMutation
,
FormFooterActions
,
FormFooterActions
,
...
...
spec/frontend/terraform/components/states_table_actions_spec.js
View file @
54d8e51b
This diff is collapsed.
Click to expand it.
spec/frontend/terraform/components/terraform_list_spec.js
View file @
54d8e51b
This diff is collapsed.
Click to expand it.
spec/frontend/token_access/token_access_spec.js
View file @
54d8e51b
This diff is collapsed.
Click to expand it.
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