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
f2e76472
Commit
f2e76472
authored
Jan 21, 2022
by
Stanislav Lashmanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove localVue usage from non-EE tests without VueApollo
Epic:
https://gitlab.com/gitlab-org/gitlab/-/issues/220482
parent
6d0438a4
Changes
45
Hide whitespace changes
Inline
Side-by-side
Showing
45 changed files
with
141 additions
and
207 deletions
+141
-207
spec/frontend/notes/components/discussion_counter_spec.js
spec/frontend/notes/components/discussion_counter_spec.js
+8
-8
spec/frontend/notes/components/discussion_filter_spec.js
spec/frontend/notes/components/discussion_filter_spec.js
+3
-5
spec/frontend/notes/components/discussion_navigator_spec.js
spec/frontend/notes/components/discussion_navigator_spec.js
+4
-6
spec/frontend/notes/components/discussion_resolve_with_issue_button_spec.js
...s/components/discussion_resolve_with_issue_button_spec.js
+1
-4
spec/frontend/notes/components/note_actions_spec.js
spec/frontend/notes/components/note_actions_spec.js
+2
-4
spec/frontend/notes/components/note_header_spec.js
spec/frontend/notes/components/note_header_spec.js
+3
-5
spec/frontend/notes/components/sort_discussion_spec.js
spec/frontend/notes/components/sort_discussion_spec.js
+3
-4
spec/frontend/notes/components/timeline_toggle_spec.js
spec/frontend/notes/components/timeline_toggle_spec.js
+3
-4
spec/frontend/notes/mixins/discussion_navigation_spec.js
spec/frontend/notes/mixins/discussion_navigation_spec.js
+4
-5
spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/cli_commands_spec.js
...gistry/explorer/components/list_page/cli_commands_spec.js
+3
-4
spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/group_empty_state_spec.js
...y/explorer/components/list_page/group_empty_state_spec.js
+3
-4
spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/project_empty_state_spec.js
...explorer/components/list_page/project_empty_state_spec.js
+3
-4
spec/frontend/packages_and_registries/infrastructure_registry/components/details/components/app_spec.js
...ucture_registry/components/details/components/app_spec.js
+3
-5
spec/frontend/packages_and_registries/infrastructure_registry/components/details/components/details_title_spec.js
...istry/components/details/components/details_title_spec.js
+3
-4
spec/frontend/packages_and_registries/infrastructure_registry/components/details/components/terraform_installation_spec.js
...ponents/details/components/terraform_installation_spec.js
+3
-4
spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/infrastructure_search_spec.js
.../components/list/components/infrastructure_search_spec.js
+3
-4
spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/packages_list_app_spec.js
...stry/components/list/components/packages_list_app_spec.js
+3
-4
spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/packages_list_spec.js
...registry/components/list/components/packages_list_spec.js
+3
-4
spec/frontend/packages_and_registries/package_registry/components/list/package_list_row_spec.js
...package_registry/components/list/package_list_row_spec.js
+2
-4
spec/frontend/pipeline_editor/components/commit/commit_section_spec.js
.../pipeline_editor/components/commit/commit_section_spec.js
+3
-5
spec/frontend/pipelines/test_reports/test_case_details_spec.js
...frontend/pipelines/test_reports/test_case_details_spec.js
+1
-4
spec/frontend/pipelines/test_reports/test_reports_spec.js
spec/frontend/pipelines/test_reports/test_reports_spec.js
+3
-4
spec/frontend/pipelines/test_reports/test_suite_table_spec.js
.../frontend/pipelines/test_reports/test_suite_table_spec.js
+3
-4
spec/frontend/pipelines/test_reports/test_summary_table_spec.js
...rontend/pipelines/test_reports/test_summary_table_spec.js
+3
-4
spec/frontend/projects/commits/components/author_select_spec.js
...rontend/projects/commits/components/author_select_spec.js
+3
-4
spec/frontend/ref/components/ref_selector_spec.js
spec/frontend/ref/components/ref_selector_spec.js
+7
-8
spec/frontend/releases/components/asset_links_form_spec.js
spec/frontend/releases/components/asset_links_form_spec.js
+3
-4
spec/frontend/releases/components/releases_pagination_spec.js
.../frontend/releases/components/releases_pagination_spec.js
+3
-4
spec/frontend/releases/components/releases_sort_spec.js
spec/frontend/releases/components/releases_sort_spec.js
+3
-4
spec/frontend/releases/components/tag_field_exsting_spec.js
spec/frontend/releases/components/tag_field_exsting_spec.js
+3
-4
spec/frontend/reports/accessibility_report/grouped_accessibility_reports_app_spec.js
...sibility_report/grouped_accessibility_reports_app_spec.js
+4
-6
spec/frontend/reports/codequality_report/grouped_codequality_reports_app_spec.js
...odequality_report/grouped_codequality_reports_app_spec.js
+3
-4
spec/frontend/reports/grouped_test_report/components/test_issue_body_spec.js
...ts/grouped_test_report/components/test_issue_body_spec.js
+3
-4
spec/frontend/reports/grouped_test_report/grouped_test_reports_app_spec.js
...orts/grouped_test_report/grouped_test_reports_app_spec.js
+3
-4
spec/frontend/search/sidebar/components/confidentiality_filter_spec.js
.../search/sidebar/components/confidentiality_filter_spec.js
+3
-4
spec/frontend/search/sidebar/components/radio_filter_spec.js
spec/frontend/search/sidebar/components/radio_filter_spec.js
+3
-4
spec/frontend/search/sidebar/components/status_filter_spec.js
.../frontend/search/sidebar/components/status_filter_spec.js
+3
-4
spec/frontend/search/sort/components/app_spec.js
spec/frontend/search/sort/components/app_spec.js
+3
-4
spec/frontend/serverless/components/function_details_spec.js
spec/frontend/serverless/components/function_details_spec.js
+3
-8
spec/frontend/serverless/components/functions_spec.js
spec/frontend/serverless/components/functions_spec.js
+8
-9
spec/frontend/static_site_editor/pages/home_spec.js
spec/frontend/static_site_editor/pages/home_spec.js
+1
-4
spec/frontend/user_lists/components/edit_user_list_spec.js
spec/frontend/user_lists/components/edit_user_list_spec.js
+2
-4
spec/frontend/user_lists/components/new_user_list_spec.js
spec/frontend/user_lists/components/new_user_list_spec.js
+2
-4
spec/frontend/vue_mr_widget/components/states/mr_widget_squash_before_merge_spec.js
...t/components/states/mr_widget_squash_before_merge_spec.js
+2
-5
spec/frontend/whats_new/components/app_spec.js
spec/frontend/whats_new/components/app_spec.js
+3
-4
No files found.
spec/frontend/notes/components/discussion_counter_spec.js
View file @
f2e76472
import
{
GlButton
}
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
DiscussionCounter
from
'
~/notes/components/discussion_counter.vue
'
;
import
notesModule
from
'
~/notes/stores/modules
'
;
...
...
@@ -10,9 +11,8 @@ describe('DiscussionCounter component', () => {
let
store
;
let
wrapper
;
let
setExpandDiscussionsFn
;
const
localVue
=
createLocalVue
();
local
Vue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
beforeEach
(()
=>
{
window
.
mrTabs
=
{};
...
...
@@ -45,7 +45,7 @@ describe('DiscussionCounter component', () => {
describe
(
'
has no discussions
'
,
()
=>
{
it
(
'
does not render
'
,
()
=>
{
wrapper
=
shallowMount
(
DiscussionCounter
,
{
store
,
localVue
});
wrapper
=
shallowMount
(
DiscussionCounter
,
{
store
});
expect
(
wrapper
.
find
({
ref
:
'
discussionCounter
'
}).
exists
()).
toBe
(
false
);
});
...
...
@@ -55,7 +55,7 @@ describe('DiscussionCounter component', () => {
it
(
'
does not render
'
,
()
=>
{
store
.
commit
(
types
.
ADD_OR_UPDATE_DISCUSSIONS
,
[{
...
discussionMock
,
resolvable
:
false
}]);
store
.
dispatch
(
'
updateResolvableDiscussionsCounts
'
);
wrapper
=
shallowMount
(
DiscussionCounter
,
{
store
,
localVue
});
wrapper
=
shallowMount
(
DiscussionCounter
,
{
store
});
expect
(
wrapper
.
find
({
ref
:
'
discussionCounter
'
}).
exists
()).
toBe
(
false
);
});
...
...
@@ -75,7 +75,7 @@ describe('DiscussionCounter component', () => {
it
(
'
renders
'
,
()
=>
{
updateStore
();
wrapper
=
shallowMount
(
DiscussionCounter
,
{
store
,
localVue
});
wrapper
=
shallowMount
(
DiscussionCounter
,
{
store
});
expect
(
wrapper
.
find
({
ref
:
'
discussionCounter
'
}).
exists
()).
toBe
(
true
);
});
...
...
@@ -86,7 +86,7 @@ describe('DiscussionCounter component', () => {
${
'
allResolved
'
}
|
${
true
}
|
${
true
}
|
${
1
}
`
(
'
renders correctly if $title
'
,
({
resolved
,
isActive
,
groupLength
})
=>
{
updateStore
({
resolvable
:
true
,
resolved
});
wrapper
=
shallowMount
(
DiscussionCounter
,
{
store
,
localVue
});
wrapper
=
shallowMount
(
DiscussionCounter
,
{
store
});
expect
(
wrapper
.
find
(
`.is-active`
).
exists
()).
toBe
(
isActive
);
expect
(
wrapper
.
findAll
(
GlButton
)).
toHaveLength
(
groupLength
);
...
...
@@ -99,7 +99,7 @@ describe('DiscussionCounter component', () => {
const
discussion
=
{
...
discussionMock
,
expanded
};
store
.
commit
(
types
.
ADD_OR_UPDATE_DISCUSSIONS
,
[
discussion
]);
store
.
dispatch
(
'
updateResolvableDiscussionsCounts
'
);
wrapper
=
shallowMount
(
DiscussionCounter
,
{
store
,
localVue
});
wrapper
=
shallowMount
(
DiscussionCounter
,
{
store
});
toggleAllButton
=
wrapper
.
find
(
'
.toggle-all-discussions-btn
'
);
};
...
...
spec/frontend/notes/components/discussion_filter_spec.js
View file @
f2e76472
import
{
GlDropdown
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
mount
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
AxiosMockAdapter
from
'
axios-mock-adapter
'
;
import
Vuex
from
'
vuex
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
...
...
@@ -12,9 +13,7 @@ import notesModule from '~/notes/stores/modules';
import
{
discussionFiltersMock
,
discussionMock
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
const
DISCUSSION_PATH
=
`
${
TEST_HOST
}
/example`
;
...
...
@@ -58,7 +57,6 @@ describe('DiscussionFilter component', () => {
filters
:
discussionFiltersMock
,
selectedValue
:
DISCUSSION_FILTERS_DEFAULT_VALUE
,
},
localVue
,
});
};
...
...
spec/frontend/notes/components/discussion_navigator_spec.js
View file @
f2e76472
/* global Mousetrap */
import
'
mousetrap
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
{
keysFor
,
...
...
@@ -11,8 +11,6 @@ import DiscussionNavigator from '~/notes/components/discussion_navigator.vue';
import
eventHub
from
'
~/notes/event_hub
'
;
describe
(
'
notes/components/discussion_navigator
'
,
()
=>
{
const
localVue
=
createLocalVue
();
let
wrapper
;
let
jumpToNextDiscussion
;
let
jumpToPreviousDiscussion
;
...
...
@@ -20,12 +18,12 @@ describe('notes/components/discussion_navigator', () => {
const
createComponent
=
()
=>
{
wrapper
=
shallowMount
(
DiscussionNavigator
,
{
mixins
:
[
localVue
.
extend
(
{
{
methods
:
{
jumpToNextDiscussion
,
jumpToPreviousDiscussion
,
},
}
)
,
},
],
});
};
...
...
@@ -48,7 +46,7 @@ describe('notes/components/discussion_navigator', () => {
beforeEach
(()
=>
{
onSpy
=
jest
.
spyOn
(
eventHub
,
'
$on
'
);
vm
=
new
(
Vue
.
extend
(
DiscussionNavigator
))(
);
vm
=
new
Vue
(
DiscussionNavigator
);
});
it
(
'
listens for jumpToFirstUnresolvedDiscussion events
'
,
()
=>
{
...
...
spec/frontend/notes/components/discussion_resolve_with_issue_button_spec.js
View file @
f2e76472
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
import
ResolveWithIssueButton
from
'
~/notes/components/discussion_resolve_with_issue_button.vue
'
;
const
localVue
=
createLocalVue
();
describe
(
'
ResolveWithIssueButton
'
,
()
=>
{
let
wrapper
;
const
url
=
`
${
TEST_HOST
}
/hello-world/`
;
beforeEach
(()
=>
{
wrapper
=
shallowMount
(
ResolveWithIssueButton
,
{
localVue
,
propsData
:
{
url
,
},
...
...
spec/frontend/notes/components/note_actions_spec.js
View file @
f2e76472
import
{
mount
,
create
LocalVue
,
create
Wrapper
}
from
'
@vue/test-utils
'
;
import
{
mount
,
createWrapper
}
from
'
@vue/test-utils
'
;
import
AxiosMockAdapter
from
'
axios-mock-adapter
'
;
import
Vue
from
'
vue
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
...
...
@@ -20,11 +20,9 @@ describe('noteActions', () => {
const
findUserAccessRoleBadgeText
=
(
idx
)
=>
findUserAccessRoleBadge
(
idx
).
text
().
trim
();
const
mountNoteActions
=
(
propsData
,
computed
)
=>
{
const
localVue
=
createLocalVue
();
return
mount
(
localVue
.
extend
(
noteActions
),
{
return
mount
(
noteActions
,
{
store
,
propsData
,
localVue
,
computed
,
});
};
...
...
spec/frontend/notes/components/note_header_spec.js
View file @
f2e76472
import
{
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
NoteHeader
from
'
~/notes/components/note_header.vue
'
;
import
{
AVAILABILITY_STATUS
}
from
'
~/set_status_modal/utils
'
;
import
UserNameWithStatus
from
'
~/sidebar/components/assignees/user_name_with_status.vue
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
const
actions
=
{
setTargetNoteHash
:
jest
.
fn
(),
...
...
@@ -42,7 +41,6 @@ describe('NoteHeader component', () => {
const
createComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
NoteHeader
,
{
localVue
,
store
:
new
Vuex
.
Store
({
actions
,
}),
...
...
spec/frontend/notes/components/sort_discussion_spec.js
View file @
f2e76472
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
SortDiscussion
from
'
~/notes/components/sort_discussion.vue
'
;
import
{
ASC
,
DESC
}
from
'
~/notes/constants
'
;
...
...
@@ -6,8 +7,7 @@ import createStore from '~/notes/stores';
import
Tracking
from
'
~/tracking
'
;
import
LocalStorageSync
from
'
~/vue_shared/components/local_storage_sync.vue
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Sort Discussion component
'
,
()
=>
{
let
wrapper
;
...
...
@@ -17,7 +17,6 @@ describe('Sort Discussion component', () => {
jest
.
spyOn
(
store
,
'
dispatch
'
).
mockImplementation
();
wrapper
=
shallowMount
(
SortDiscussion
,
{
localVue
,
store
,
});
};
...
...
spec/frontend/notes/components/timeline_toggle_spec.js
View file @
f2e76472
import
{
GlButton
}
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
TimelineToggle
,
{
timelineEnabledTooltip
,
...
...
@@ -10,8 +11,7 @@ import createStore from '~/notes/stores';
import
{
trackToggleTimelineView
}
from
'
~/notes/utils
'
;
import
Tracking
from
'
~/tracking
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Timeline toggle
'
,
()
=>
{
let
wrapper
;
...
...
@@ -23,7 +23,6 @@ describe('Timeline toggle', () => {
jest
.
spyOn
(
Tracking
,
'
event
'
).
mockImplementation
();
wrapper
=
shallowMount
(
TimelineToggle
,
{
localVue
,
store
,
});
};
...
...
spec/frontend/notes/mixins/discussion_navigation_spec.js
View file @
f2e76472
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
{
setHTMLFixture
}
from
'
helpers/fixtures
'
;
import
createEventHub
from
'
~/helpers/event_hub_factory
'
;
...
...
@@ -27,8 +27,7 @@ const createComponent = () => ({
});
describe
(
'
Discussion navigation mixin
'
,
()
=>
{
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
let
wrapper
;
let
store
;
...
...
@@ -65,7 +64,7 @@ describe('Discussion navigation mixin', () => {
});
store
.
state
.
notes
.
discussions
=
createDiscussions
();
wrapper
=
shallowMount
(
createComponent
(),
{
store
,
localVue
});
wrapper
=
shallowMount
(
createComponent
(),
{
store
});
});
afterEach
(()
=>
{
...
...
spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/cli_commands_spec.js
View file @
f2e76472
import
{
GlDropdown
}
from
'
@gitlab/ui
'
;
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
QuickstartDropdown
from
'
~/packages_and_registries/shared/components/cli_commands.vue
'
;
import
{
...
...
@@ -16,8 +17,7 @@ import CodeInstruction from '~/vue_shared/components/registry/code_instruction.v
import
{
dockerCommands
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
cli_commands
'
,
()
=>
{
let
wrapper
;
...
...
@@ -27,7 +27,6 @@ describe('cli_commands', () => {
const
mountComponent
=
()
=>
{
wrapper
=
mount
(
QuickstartDropdown
,
{
localVue
,
propsData
:
{
...
dockerCommands
,
},
...
...
spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/group_empty_state_spec.js
View file @
f2e76472
import
{
GlSprintf
}
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
groupEmptyState
from
'
~/packages_and_registries/container_registry/explorer/components/list_page/group_empty_state.vue
'
;
import
{
GlEmptyState
}
from
'
../../stubs
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Registry Group Empty state
'
,
()
=>
{
let
wrapper
;
...
...
@@ -16,7 +16,6 @@ describe('Registry Group Empty state', () => {
beforeEach
(()
=>
{
wrapper
=
shallowMount
(
groupEmptyState
,
{
localVue
,
stubs
:
{
GlEmptyState
,
GlSprintf
,
...
...
spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/project_empty_state_spec.js
View file @
f2e76472
import
{
GlSprintf
}
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
projectEmptyState
from
'
~/packages_and_registries/container_registry/explorer/components/list_page/project_empty_state.vue
'
;
import
{
dockerCommands
}
from
'
../../mock_data
'
;
import
{
GlEmptyState
}
from
'
../../stubs
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Registry Project Empty state
'
,
()
=>
{
let
wrapper
;
...
...
@@ -21,7 +21,6 @@ describe('Registry Project Empty state', () => {
beforeEach
(()
=>
{
wrapper
=
shallowMount
(
projectEmptyState
,
{
localVue
,
stubs
:
{
GlEmptyState
,
GlSprintf
,
...
...
spec/frontend/packages_and_registries/infrastructure_registry/components/details/components/app_spec.js
View file @
f2e76472
import
{
GlEmptyState
}
from
'
@gitlab/ui
'
;
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
nextTick
}
from
'
vue
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
{
useMockLocationHelper
}
from
'
helpers/mock_window_location_helper
'
;
import
stubChildren
from
'
helpers/stub_children
'
;
...
...
@@ -19,8 +19,7 @@ import Tracking from '~/tracking';
import
{
mavenPackage
,
mavenFiles
,
npmPackage
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
useMockLocationHelper
();
...
...
@@ -60,7 +59,6 @@ describe('PackagesApp', () => {
});
wrapper
=
mount
(
PackagesApp
,
{
localVue
,
store
,
stubs
:
{
...
stubChildren
(
PackagesApp
),
...
...
spec/frontend/packages_and_registries/infrastructure_registry/components/details/components/details_title_spec.js
View file @
f2e76472
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
component
from
'
~/packages_and_registries/infrastructure_registry/details/components/details_title.vue
'
;
import
TitleArea
from
'
~/vue_shared/components/registry/title_area.vue
'
;
import
{
terraformModule
,
mavenFiles
,
npmPackage
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
PackageTitle
'
,
()
=>
{
let
wrapper
;
...
...
@@ -23,7 +23,6 @@ describe('PackageTitle', () => {
});
wrapper
=
shallowMount
(
component
,
{
localVue
,
store
,
stubs
:
{
TitleArea
,
...
...
spec/frontend/packages_and_registries/infrastructure_registry/components/details/components/terraform_installation_spec.js
View file @
f2e76472
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
TerraformInstallation
from
'
~/packages_and_registries/infrastructure_registry/details/components/terraform_installation.vue
'
;
import
CodeInstructions
from
'
~/vue_shared/components/registry/code_instruction.vue
'
;
import
{
terraformModule
as
packageEntity
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
TerraformInstallation
'
,
()
=>
{
let
wrapper
;
...
...
@@ -22,7 +22,6 @@ describe('TerraformInstallation', () => {
function
createComponent
()
{
wrapper
=
shallowMount
(
TerraformInstallation
,
{
localVue
,
store
,
});
}
...
...
spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/infrastructure_search_spec.js
View file @
f2e76472
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
component
from
'
~/packages_and_registries/infrastructure_registry/list/components/infrastructure_search.vue
'
;
import
RegistrySearch
from
'
~/vue_shared/components/registry/registry_search.vue
'
;
import
UrlSync
from
'
~/vue_shared/components/url_sync.vue
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Infrastructure Search
'
,
()
=>
{
let
wrapper
;
...
...
@@ -48,7 +48,6 @@ describe('Infrastructure Search', () => {
createStore
(
isGroupPage
);
wrapper
=
shallowMount
(
component
,
{
localVue
,
store
,
stubs
:
{
UrlSync
,
...
...
spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/packages_list_app_spec.js
View file @
f2e76472
import
{
GlEmptyState
,
GlSprintf
,
GlLink
}
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
setWindowLocation
from
'
helpers/set_window_location_helper
'
;
import
createFlash
from
'
~/flash
'
;
...
...
@@ -17,8 +18,7 @@ import InfrastructureSearch from '~/packages_and_registries/infrastructure_regis
jest
.
mock
(
'
~/lib/utils/common_utils
'
);
jest
.
mock
(
'
~/flash
'
);
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
packages_list_app
'
,
()
=>
{
let
wrapper
;
...
...
@@ -53,7 +53,6 @@ describe('packages_list_app', () => {
const
mountComponent
=
(
provide
)
=>
{
wrapper
=
shallowMount
(
PackageListApp
,
{
localVue
,
store
,
stubs
:
{
GlEmptyState
,
...
...
spec/frontend/packages_and_registries/infrastructure_registry/components/list/components/packages_list_spec.js
View file @
f2e76472
import
{
GlTable
,
GlPagination
,
GlModal
}
from
'
@gitlab/ui
'
;
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
{
last
}
from
'
lodash
'
;
import
Vuex
from
'
vuex
'
;
import
stubChildren
from
'
helpers/stub_children
'
;
...
...
@@ -11,8 +12,7 @@ import { TRACK_CATEGORY } from '~/packages_and_registries/infrastructure_registr
import
Tracking
from
'
~/tracking
'
;
import
{
packageList
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
packages_list
'
,
()
=>
{
let
wrapper
;
...
...
@@ -61,7 +61,6 @@ describe('packages_list', () => {
createStore
(
isGroupPage
,
packages
,
isLoading
);
wrapper
=
mount
(
PackagesList
,
{
localVue
,
store
,
stubs
:
{
...
stubChildren
(
PackagesList
),
...
...
spec/frontend/packages_and_registries/package_registry/components/list/package_list_row_spec.js
View file @
f2e76472
import
{
GlSprintf
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueRouter
from
'
vue-router
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
...
...
@@ -17,8 +17,7 @@ import { PACKAGE_ERROR_STATUS } from '~/packages_and_registries/package_registry
import
ListItem
from
'
~/vue_shared/components/registry/list_item.vue
'
;
import
{
packageData
,
packagePipelines
,
packageProject
,
packageTags
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
VueRouter
);
Vue
.
use
(
VueRouter
);
describe
(
'
packages_list_row
'
,
()
=>
{
let
wrapper
;
...
...
@@ -47,7 +46,6 @@ describe('packages_list_row', () => {
provide
=
defaultProvide
,
}
=
{})
=>
{
wrapper
=
shallowMountExtended
(
PackagesListRow
,
{
localVue
,
provide
,
stubs
:
{
ListItem
,
...
...
spec/frontend/pipeline_editor/components/commit/commit_section_spec.js
View file @
f2e76472
import
VueApollo
from
'
vue-apollo
'
;
import
{
GlFormTextarea
,
GlFormInput
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
mount
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
import
{
objectToQuery
,
redirectTo
}
from
'
~/lib/utils/url_utility
'
;
...
...
@@ -26,8 +27,6 @@ import {
mockNewMergeRequestPath
,
}
from
'
../../mock_data
'
;
const
localVue
=
createLocalVue
();
jest
.
mock
(
'
~/lib/utils/url_utility
'
,
()
=>
({
redirectTo
:
jest
.
fn
(),
refreshCurrentPage
:
jest
.
fn
(),
...
...
@@ -79,11 +78,10 @@ describe('Pipeline Editor | Commit section', () => {
const
createComponentWithApollo
=
(
options
)
=>
{
const
handlers
=
[[
commitCreate
,
mockMutateCommitData
]];
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
mockApollo
=
createMockApollo
(
handlers
);
const
apolloConfig
=
{
localVue
,
apolloProvider
:
mockApollo
,
};
...
...
spec/frontend/pipelines/test_reports/test_case_details_spec.js
View file @
f2e76472
import
{
GlModal
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
TestCaseDetails
from
'
~/pipelines/components/test_reports/test_case_details.vue
'
;
import
CodeBlock
from
'
~/vue_shared/components/code_block.vue
'
;
const
localVue
=
createLocalVue
();
describe
(
'
Test case details
'
,
()
=>
{
let
wrapper
;
const
defaultTestCase
=
{
...
...
@@ -29,7 +27,6 @@ describe('Test case details', () => {
const
createComponent
=
(
testCase
=
{})
=>
{
wrapper
=
extendedWrapper
(
shallowMount
(
TestCaseDetails
,
{
localVue
,
propsData
:
{
modalId
:
'
my-modal
'
,
testCase
:
{
...
...
spec/frontend/pipelines/test_reports/test_reports_spec.js
View file @
f2e76472
import
{
GlLoadingIcon
}
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
testReports
from
'
test_fixtures/pipelines/test_report.json
'
;
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
...
...
@@ -9,8 +10,7 @@ import TestSummary from '~/pipelines/components/test_reports/test_summary.vue';
import
TestSummaryTable
from
'
~/pipelines/components/test_reports/test_summary_table.vue
'
;
import
*
as
getters
from
'
~/pipelines/stores/test_reports/getters
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Test reports app
'
,
()
=>
{
let
wrapper
;
...
...
@@ -44,7 +44,6 @@ describe('Test reports app', () => {
wrapper
=
extendedWrapper
(
shallowMount
(
TestReports
,
{
store
,
localVue
,
}),
);
};
...
...
spec/frontend/pipelines/test_reports/test_suite_table_spec.js
View file @
f2e76472
import
{
GlButton
,
GlFriendlyWrap
,
GlLink
,
GlPagination
}
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
testReports
from
'
test_fixtures/pipelines/test_report.json
'
;
import
SuiteTable
from
'
~/pipelines/components/test_reports/test_suite_table.vue
'
;
...
...
@@ -8,8 +9,7 @@ import * as getters from '~/pipelines/stores/test_reports/getters';
import
{
formatFilePath
}
from
'
~/pipelines/stores/test_reports/utils
'
;
import
skippedTestCases
from
'
./mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Test reports suite table
'
,
()
=>
{
let
wrapper
;
...
...
@@ -47,7 +47,6 @@ describe('Test reports suite table', () => {
wrapper
=
shallowMount
(
SuiteTable
,
{
store
,
localVue
,
stubs
:
{
GlFriendlyWrap
},
});
};
...
...
spec/frontend/pipelines/test_reports/test_summary_table_spec.js
View file @
f2e76472
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
testReports
from
'
test_fixtures/pipelines/test_report.json
'
;
import
SummaryTable
from
'
~/pipelines/components/test_reports/test_summary_table.vue
'
;
import
*
as
getters
from
'
~/pipelines/stores/test_reports/getters
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Test reports summary table
'
,
()
=>
{
let
wrapper
;
...
...
@@ -29,7 +29,6 @@ describe('Test reports summary table', () => {
wrapper
=
mount
(
SummaryTable
,
{
propsData
:
defaultProps
,
store
,
localVue
,
});
};
...
...
spec/frontend/projects/commits/components/author_select_spec.js
View file @
f2e76472
import
{
GlDropdown
,
GlDropdownSectionHeader
,
GlSearchBoxByType
,
GlDropdownItem
}
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
*
as
urlUtility
from
'
~/lib/utils/url_utility
'
;
import
AuthorSelect
from
'
~/projects/commits/components/author_select.vue
'
;
import
{
createStore
}
from
'
~/projects/commits/store
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
const
commitsPath
=
'
author/search/url
'
;
const
currentAuthor
=
'
lorem
'
;
...
...
@@ -38,7 +38,6 @@ describe('Author Select', () => {
`
);
wrapper
=
shallowMount
(
AuthorSelect
,
{
localVue
,
store
:
new
Vuex
.
Store
(
store
),
propsData
:
{
projectCommitsEl
:
document
.
querySelector
(
'
.js-project-commits-show
'
),
...
...
spec/frontend/ref/components/ref_selector_spec.js
View file @
f2e76472
import
{
GlLoadingIcon
,
GlSearchBoxByType
,
GlDropdownItem
,
GlDropdown
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
,
{
nextTick
}
from
'
vue
'
;
import
axios
from
'
axios
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
merge
,
last
}
from
'
lodash
'
;
...
...
@@ -20,8 +21,7 @@ import {
}
from
'
~/ref/constants
'
;
import
createStore
from
'
~/ref/stores/
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Ref selector component
'
,
()
=>
{
const
fixtures
=
{
branches
,
tags
,
commit
};
...
...
@@ -52,7 +52,6 @@ describe('Ref selector component', () => {
stubs
:
{
GlSearchBoxByType
:
true
,
},
localVue
,
store
:
createStore
(),
},
mountOverrides
,
...
...
@@ -223,7 +222,7 @@ describe('Ref selector component', () => {
it
(
'
renders the updated ref name
'
,
()
=>
{
wrapper
.
setProps
({
value
:
updatedRef
});
return
localVue
.
nextTick
().
then
(()
=>
{
return
nextTick
().
then
(()
=>
{
expect
(
findButtonContent
().
text
()).
toBe
(
updatedRef
);
});
});
...
...
@@ -547,7 +546,7 @@ describe('Ref selector component', () => {
await
selectFirstBranch
();
return
localVue
.
nextTick
().
then
(()
=>
{
return
nextTick
().
then
(()
=>
{
expect
(
findButtonContent
().
text
()).
toBe
(
fixtures
.
branches
[
0
].
name
);
});
});
...
...
@@ -567,7 +566,7 @@ describe('Ref selector component', () => {
await
selectFirstTag
();
return
localVue
.
nextTick
().
then
(()
=>
{
return
nextTick
().
then
(()
=>
{
expect
(
findButtonContent
().
text
()).
toBe
(
fixtures
.
tags
[
0
].
name
);
});
});
...
...
@@ -587,7 +586,7 @@ describe('Ref selector component', () => {
await
selectFirstCommit
();
return
localVue
.
nextTick
().
then
(()
=>
{
return
nextTick
().
then
(()
=>
{
expect
(
findButtonContent
().
text
()).
toBe
(
fixtures
.
commit
.
id
);
});
});
...
...
spec/frontend/releases/components/asset_links_form_spec.js
View file @
f2e76472
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
originalRelease
from
'
test_fixtures/api/releases/release.json
'
;
import
*
as
commonUtils
from
'
~/lib/utils/common_utils
'
;
...
...
@@ -6,8 +7,7 @@ import { ENTER_KEY } from '~/lib/utils/keys';
import
AssetLinksForm
from
'
~/releases/components/asset_links_form.vue
'
;
import
{
ASSET_LINK_TYPE
,
DEFAULT_ASSET_LINK_TYPE
}
from
'
~/releases/constants
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Release edit component
'
,
()
=>
{
let
wrapper
;
...
...
@@ -52,7 +52,6 @@ describe('Release edit component', () => {
});
wrapper
=
mount
(
AssetLinksForm
,
{
localVue
,
store
,
});
};
...
...
spec/frontend/releases/components/releases_pagination_spec.js
View file @
f2e76472
import
{
GlKeysetPagination
}
from
'
@gitlab/ui
'
;
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
{
historyPushState
}
from
'
~/lib/utils/common_utils
'
;
import
ReleasesPagination
from
'
~/releases/components/releases_pagination.vue
'
;
...
...
@@ -11,8 +12,7 @@ jest.mock('~/lib/utils/common_utils', () => ({
historyPushState
:
jest
.
fn
(),
}));
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
~/releases/components/releases_pagination.vue
'
,
()
=>
{
let
wrapper
;
...
...
@@ -39,7 +39,6 @@ describe('~/releases/components/releases_pagination.vue', () => {
},
featureFlags
:
{},
}),
localVue
,
});
};
...
...
spec/frontend/releases/components/releases_sort_spec.js
View file @
f2e76472
import
{
GlSorting
,
GlSortingItem
}
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
ReleasesSort
from
'
~/releases/components/releases_sort.vue
'
;
import
createStore
from
'
~/releases/stores
'
;
import
createIndexModule
from
'
~/releases/stores/modules/index
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
~/releases/components/releases_sort.vue
'
,
()
=>
{
let
wrapper
;
...
...
@@ -30,7 +30,6 @@ describe('~/releases/components/releases_sort.vue', () => {
stubs
:
{
GlSortingItem
,
},
localVue
,
});
};
...
...
spec/frontend/releases/components/tag_field_exsting_spec.js
View file @
f2e76472
import
{
GlFormInput
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
,
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
TagFieldExisting
from
'
~/releases/components/tag_field_existing.vue
'
;
import
createStore
from
'
~/releases/stores
'
;
...
...
@@ -7,8 +8,7 @@ import createEditNewModule from '~/releases/stores/modules/edit_new';
const
TEST_TAG_NAME
=
'
test-tag-name
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
releases/components/tag_field_existing
'
,
()
=>
{
let
store
;
...
...
@@ -17,7 +17,6 @@ describe('releases/components/tag_field_existing', () => {
const
createComponent
=
(
mountFn
=
shallowMount
)
=>
{
wrapper
=
mountFn
(
TagFieldExisting
,
{
store
,
localVue
,
});
};
...
...
spec/frontend/reports/accessibility_report/grouped_accessibility_reports_app_spec.js
View file @
f2e76472
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
AccessibilityIssueBody
from
'
~/reports/accessibility_report/components/accessibility_issue_body.vue
'
;
import
GroupedAccessibilityReportsApp
from
'
~/reports/accessibility_report/grouped_accessibility_reports_app.vue
'
;
import
{
getStoreConfig
}
from
'
~/reports/accessibility_report/store
'
;
import
{
mockReport
}
from
'
./mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Grouped accessibility reports app
'
,
()
=>
{
const
Component
=
localVue
.
extend
(
GroupedAccessibilityReportsApp
);
let
wrapper
;
let
mockStore
;
const
mountComponent
=
()
=>
{
wrapper
=
mount
(
Component
,
{
wrapper
=
mount
(
GroupedAccessibilityReportsApp
,
{
store
:
mockStore
,
localVue
,
propsData
:
{
endpoint
:
'
endpoint.json
'
,
},
...
...
spec/frontend/reports/codequality_report/grouped_codequality_reports_app_spec.js
View file @
f2e76472
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
CodequalityIssueBody
from
'
~/reports/codequality_report/components/codequality_issue_body.vue
'
;
import
GroupedCodequalityReportsApp
from
'
~/reports/codequality_report/grouped_codequality_reports_app.vue
'
;
...
...
@@ -6,8 +7,7 @@ import { getStoreConfig } from '~/reports/codequality_report/store';
import
{
STATUS_NOT_FOUND
}
from
'
~/reports/constants
'
;
import
{
parsedReportIssues
}
from
'
./mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Grouped code quality reports app
'
,
()
=>
{
let
wrapper
;
...
...
@@ -22,7 +22,6 @@ describe('Grouped code quality reports app', () => {
const
mountComponent
=
(
props
=
{})
=>
{
wrapper
=
mount
(
GroupedCodequalityReportsApp
,
{
store
:
mockStore
,
localVue
,
propsData
:
{
...
PATHS
,
...
props
,
...
...
spec/frontend/reports/grouped_test_report/components/test_issue_body_spec.js
View file @
f2e76472
import
{
GlBadge
,
GlButton
}
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
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
IssueStatusIcon
from
'
~/reports/components/issue_status_icon.vue
'
;
import
TestIssueBody
from
'
~/reports/grouped_test_report/components/test_issue_body.vue
'
;
import
{
failedIssue
,
successIssue
}
from
'
../../mock_data/mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Test issue body
'
,
()
=>
{
let
wrapper
;
...
...
@@ -29,7 +29,6 @@ describe('Test issue body', () => {
wrapper
=
extendedWrapper
(
shallowMount
(
TestIssueBody
,
{
store
,
localVue
,
propsData
:
{
issue
,
},
...
...
spec/frontend/reports/grouped_test_report/grouped_test_reports_app_spec.js
View file @
f2e76472
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
Api
from
'
~/api
'
;
import
GroupedTestReportsApp
from
'
~/reports/grouped_test_report/grouped_test_reports_app.vue
'
;
...
...
@@ -14,8 +15,7 @@ import resolvedFailures from '../mock_data/resolved_failures.json';
jest
.
mock
(
'
~/api.js
'
);
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Grouped test reports app
'
,
()
=>
{
const
endpoint
=
'
endpoint.json
'
;
...
...
@@ -27,7 +27,6 @@ describe('Grouped test reports app', () => {
const
mountComponent
=
({
props
=
{
pipelinePath
}
}
=
{})
=>
{
wrapper
=
mount
(
GroupedTestReportsApp
,
{
store
:
mockStore
,
localVue
,
propsData
:
{
endpoint
,
headBlobPath
,
...
...
spec/frontend/search/sidebar/components/confidentiality_filter_spec.js
View file @
f2e76472
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
{
MOCK_QUERY
}
from
'
jest/search/mock_data
'
;
import
ConfidentialityFilter
from
'
~/search/sidebar/components/confidentiality_filter.vue
'
;
import
RadioFilter
from
'
~/search/sidebar/components/radio_filter.vue
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
ConfidentialityFilter
'
,
()
=>
{
let
wrapper
;
...
...
@@ -25,7 +25,6 @@ describe('ConfidentialityFilter', () => {
});
wrapper
=
shallowMount
(
ConfidentialityFilter
,
{
localVue
,
store
,
});
};
...
...
spec/frontend/search/sidebar/components/radio_filter_spec.js
View file @
f2e76472
import
{
GlFormRadioGroup
,
GlFormRadio
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
{
MOCK_QUERY
}
from
'
jest/search/mock_data
'
;
import
RadioFilter
from
'
~/search/sidebar/components/radio_filter.vue
'
;
import
{
confidentialFilterData
}
from
'
~/search/sidebar/constants/confidential_filter_data
'
;
import
{
stateFilterData
}
from
'
~/search/sidebar/constants/state_filter_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
RadioFilter
'
,
()
=>
{
let
wrapper
;
...
...
@@ -30,7 +30,6 @@ describe('RadioFilter', () => {
});
wrapper
=
shallowMount
(
RadioFilter
,
{
localVue
,
store
,
propsData
:
{
...
defaultProps
,
...
...
spec/frontend/search/sidebar/components/status_filter_spec.js
View file @
f2e76472
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
{
MOCK_QUERY
}
from
'
jest/search/mock_data
'
;
import
RadioFilter
from
'
~/search/sidebar/components/radio_filter.vue
'
;
import
StatusFilter
from
'
~/search/sidebar/components/status_filter.vue
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
StatusFilter
'
,
()
=>
{
let
wrapper
;
...
...
@@ -25,7 +25,6 @@ describe('StatusFilter', () => {
});
wrapper
=
shallowMount
(
StatusFilter
,
{
localVue
,
store
,
});
};
...
...
spec/frontend/search/sort/components/app_spec.js
View file @
f2e76472
import
{
GlButtonGroup
,
GlButton
,
GlDropdown
,
GlDropdownItem
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
{
MOCK_QUERY
,
MOCK_SORT_OPTIONS
}
from
'
jest/search/mock_data
'
;
import
GlobalSearchSort
from
'
~/search/sort/components/app.vue
'
;
import
{
SORT_DIRECTION_UI
}
from
'
~/search/sort/constants
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
GlobalSearchSort
'
,
()
=>
{
let
wrapper
;
...
...
@@ -30,7 +30,6 @@ describe('GlobalSearchSort', () => {
});
wrapper
=
shallowMount
(
GlobalSearchSort
,
{
localVue
,
store
,
propsData
:
{
...
defaultProps
,
...
...
spec/frontend/serverless/components/function_details_spec.js
View file @
f2e76472
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
functionDetailsComponent
from
'
~/serverless/components/function_details.vue
'
;
import
{
createStore
}
from
'
~/serverless/store
'
;
describe
(
'
functionDetailsComponent
'
,
()
=>
{
let
localVue
;
let
component
;
let
store
;
beforeEach
(()
=>
{
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
store
=
createStore
({
clustersPath
:
'
/clusters
'
,
helpPath
:
'
/help
'
});
});
...
...
@@ -33,7 +32,6 @@ describe('functionDetailsComponent', () => {
it
(
'
has a name, description, URL, and no pods loaded
'
,
()
=>
{
component
=
shallowMount
(
functionDetailsComponent
,
{
localVue
,
store
,
propsData
:
{
func
:
serviceStub
,
...
...
@@ -58,7 +56,6 @@ describe('functionDetailsComponent', () => {
serviceStub
.
podcount
=
1
;
component
=
shallowMount
(
functionDetailsComponent
,
{
localVue
,
store
,
propsData
:
{
func
:
serviceStub
,
...
...
@@ -73,7 +70,6 @@ describe('functionDetailsComponent', () => {
serviceStub
.
podcount
=
3
;
component
=
shallowMount
(
functionDetailsComponent
,
{
localVue
,
store
,
propsData
:
{
func
:
serviceStub
,
...
...
@@ -88,7 +84,6 @@ describe('functionDetailsComponent', () => {
serviceStub
.
description
=
null
;
component
=
shallowMount
(
functionDetailsComponent
,
{
localVue
,
store
,
propsData
:
{
func
:
serviceStub
,
...
...
spec/frontend/serverless/components/functions_spec.js
View file @
f2e76472
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
AxiosMockAdapter
from
'
axios-mock-adapter
'
;
import
Vuex
from
'
vuex
'
;
import
{
TEST_HOST
}
from
'
helpers/test_constants
'
;
...
...
@@ -15,15 +16,13 @@ describe('functionsComponent', () => {
let
component
;
let
store
;
let
localVue
;
let
axiosMock
;
beforeEach
(()
=>
{
axiosMock
=
new
AxiosMockAdapter
(
axios
);
axiosMock
.
onGet
(
statusPath
).
reply
(
200
);
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
store
=
createStore
({});
});
...
...
@@ -35,21 +34,21 @@ describe('functionsComponent', () => {
it
(
'
should render empty state when Knative is not installed
'
,
()
=>
{
store
.
dispatch
(
'
receiveFunctionsSuccess
'
,
{
knative_installed
:
false
});
component
=
shallowMount
(
functionsComponent
,
{
localVue
,
store
});
component
=
shallowMount
(
functionsComponent
,
{
store
});
expect
(
component
.
find
(
EmptyState
).
exists
()).
toBe
(
true
);
});
it
(
'
should render a loading component
'
,
()
=>
{
store
.
dispatch
(
'
requestFunctionsLoading
'
);
component
=
shallowMount
(
functionsComponent
,
{
localVue
,
store
});
component
=
shallowMount
(
functionsComponent
,
{
store
});
expect
(
component
.
find
(
GlLoadingIcon
).
exists
()).
toBe
(
true
);
});
it
(
'
should render empty state when there is no function data
'
,
()
=>
{
store
.
dispatch
(
'
receiveFunctionsNoDataSuccess
'
,
{
knative_installed
:
true
});
component
=
shallowMount
(
functionsComponent
,
{
localVue
,
store
});
component
=
shallowMount
(
functionsComponent
,
{
store
});
expect
(
component
.
vm
.
$el
...
...
@@ -68,7 +67,7 @@ describe('functionsComponent', () => {
knative_installed
:
'
checking
'
,
});
component
=
shallowMount
(
functionsComponent
,
{
localVue
,
store
});
component
=
shallowMount
(
functionsComponent
,
{
store
});
expect
(
component
.
find
(
'
.js-functions-wrapper
'
).
exists
()).
toBe
(
true
);
expect
(
component
.
find
(
'
.js-functions-loader
'
).
exists
()).
toBe
(
true
);
...
...
@@ -77,7 +76,7 @@ describe('functionsComponent', () => {
it
(
'
should render the functions list
'
,
()
=>
{
store
=
createStore
({
clustersPath
:
'
clustersPath
'
,
helpPath
:
'
helpPath
'
,
statusPath
});
component
=
shallowMount
(
functionsComponent
,
{
localVue
,
store
});
component
=
shallowMount
(
functionsComponent
,
{
store
});
component
.
vm
.
$store
.
dispatch
(
'
receiveFunctionsSuccess
'
,
mockServerlessFunctions
);
...
...
spec/frontend/static_site_editor/pages/home_spec.js
View file @
f2e76472
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
mockTracking
,
unmockTracking
}
from
'
helpers/tracking_helper
'
;
import
EditArea
from
'
~/static_site_editor/components/edit_area.vue
'
;
import
EditMetaModal
from
'
~/static_site_editor/components/edit_meta_modal.vue
'
;
...
...
@@ -29,8 +29,6 @@ import {
imageRoot
,
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
describe
(
'
static_site_editor/pages/home
'
,
()
=>
{
let
wrapper
;
let
store
;
...
...
@@ -78,7 +76,6 @@ describe('static_site_editor/pages/home', () => {
const
buildWrapper
=
(
data
=
{})
=>
{
wrapper
=
shallowMount
(
Home
,
{
localVue
,
store
,
mocks
:
{
$apollo
,
...
...
spec/frontend/user_lists/components/edit_user_list_spec.js
View file @
f2e76472
import
{
GlAlert
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
mount
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
...
@@ -13,8 +13,7 @@ import { userList } from '../../feature_flags/mock_data';
jest
.
mock
(
'
~/api
'
);
jest
.
mock
(
'
~/lib/utils/url_utility
'
);
const
localVue
=
createLocalVue
(
Vue
);
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
user_lists/components/edit_user_list
'
,
()
=>
{
let
wrapper
;
...
...
@@ -30,7 +29,6 @@ describe('user_lists/components/edit_user_list', () => {
destroy
();
wrapper
=
mount
(
EditUserList
,
{
localVue
,
store
:
createStore
({
projectId
:
'
1
'
,
userListIid
:
'
2
'
}),
provide
:
{
userListsDocsPath
:
'
/docs/user_lists
'
,
...
...
spec/frontend/user_lists/components/new_user_list_spec.js
View file @
f2e76472
import
{
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
waitForPromises
from
'
helpers/wait_for_promises
'
;
...
...
@@ -12,8 +12,7 @@ import { userList } from '../../feature_flags/mock_data';
jest
.
mock
(
'
~/api
'
);
jest
.
mock
(
'
~/lib/utils/url_utility
'
);
const
localVue
=
createLocalVue
(
Vue
);
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
user_lists/components/new_user_list
'
,
()
=>
{
let
wrapper
;
...
...
@@ -24,7 +23,6 @@ describe('user_lists/components/new_user_list', () => {
beforeEach
(()
=>
{
wrapper
=
mount
(
NewUserList
,
{
localVue
,
store
:
createStore
({
projectId
:
'
1
'
}),
provide
:
{
featureFlagsPath
:
'
/feature_flags
'
,
...
...
spec/frontend/vue_mr_widget/components/states/mr_widget_squash_before_merge_spec.js
View file @
f2e76472
import
{
GlFormCheckbox
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
SquashBeforeMerge
from
'
~/vue_merge_request_widget/components/states/squash_before_merge.vue
'
;
import
{
SQUASH_BEFORE_MERGE
}
from
'
~/vue_merge_request_widget/i18n
'
;
const
localVue
=
createLocalVue
();
describe
(
'
Squash before merge component
'
,
()
=>
{
let
wrapper
;
const
createComponent
=
(
props
)
=>
{
wrapper
=
shallowMount
(
localVue
.
extend
(
SquashBeforeMerge
),
{
localVue
,
wrapper
=
shallowMount
(
SquashBeforeMerge
,
{
propsData
:
{
...
props
,
},
...
...
spec/frontend/whats_new/components/app_spec.js
View file @
f2e76472
import
{
GlDrawer
,
GlInfiniteScroll
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
mount
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
{
mockTracking
,
unmockTracking
,
triggerEvent
}
from
'
helpers/tracking_helper
'
;
import
{
createMockDirective
,
getBinding
}
from
'
helpers/vue_mock_directive
'
;
...
...
@@ -12,8 +13,7 @@ jest.mock('~/whats_new/utils/get_drawer_body_height', () => ({
getDrawerBodyHeight
:
jest
.
fn
().
mockImplementation
(()
=>
MOCK_DRAWER_BODY_HEIGHT
),
}));
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
App
'
,
()
=>
{
let
wrapper
;
...
...
@@ -46,7 +46,6 @@ describe('App', () => {
});
wrapper
=
mount
(
App
,
{
localVue
,
store
,
propsData
:
buildProps
(),
directives
:
{
...
...
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