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
fbc0f631
Commit
fbc0f631
authored
Dec 08, 2021
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use global Vue instance in Jest (admin)
parent
6c464495
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
18 deletions
+12
-18
ee/spec/frontend/admin/subscriptions/show/components/app_spec.js
.../frontend/admin/subscriptions/show/components/app_spec.js
+4
-5
ee/spec/frontend/admin/subscriptions/show/components/subscription_activation_form_spec.js
...ions/show/components/subscription_activation_form_spec.js
+3
-5
spec/frontend/admin/statistics_panel/components/app_spec.js
spec/frontend/admin/statistics_panel/components/app_spec.js
+3
-4
spec/frontend/admin/users/components/users_table_spec.js
spec/frontend/admin/users/components/users_table_spec.js
+2
-4
No files found.
ee/spec/frontend/admin/subscriptions/show/components/app_spec.js
View file @
fbc0f631
import
{
GlButton
}
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
SubscriptionManagementApp
from
'
ee/admin/subscriptions/show/components/app.vue
'
;
import
SubscriptionActivationCard
from
'
ee/admin/subscriptions/show/components/subscription_activation_card.vue
'
;
...
...
@@ -19,8 +20,7 @@ import createMockApollo from 'helpers/mock_apollo_helper';
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
{
license
,
subscriptionHistory
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
describe
(
'
SubscriptionManagementApp
'
,
()
=>
{
// March 16th, 2020
...
...
@@ -40,7 +40,7 @@ describe('SubscriptionManagementApp', () => {
let
currentSubscriptionResolver
;
let
subscriptionHistoryResolver
;
const
createMockApolloProvider
=
([
subscriptionResolver
,
historyResolver
])
=>
{
local
Vue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
return
createMockApollo
([
[
subscriptionQueries
.
query
,
subscriptionResolver
],
[
subscriptionHistoryQueries
.
query
,
historyResolver
],
...
...
@@ -50,7 +50,6 @@ describe('SubscriptionManagementApp', () => {
const
createComponent
=
(
props
=
{},
resolverMock
)
=>
{
wrapper
=
extendedWrapper
(
shallowMount
(
SubscriptionManagementApp
,
{
localVue
,
apolloProvider
:
createMockApolloProvider
(
resolverMock
),
propsData
:
{
licenseUsageFilePath
:
'
about:blank
'
,
...
...
ee/spec/frontend/admin/subscriptions/show/components/subscription_activation_form_spec.js
View file @
fbc0f631
import
{
GlForm
,
GlFormCheckbox
,
GlFormInput
,
GlLink
,
GlSprintf
}
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
SubscriptionActivationForm
from
'
ee/admin/subscriptions/show/components/subscription_activation_form.vue
'
;
import
{
...
...
@@ -22,14 +23,12 @@ import {
fakeActivationCode
,
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
describe
(
'
SubscriptionActivationForm
'
,
()
=>
{
let
wrapper
;
const
createMockApolloProvider
=
(
resolverMock
)
=>
{
localVue
.
use
(
VueApollo
);
return
createMockApollo
([[
subscriptionQueries
.
mutation
,
resolverMock
]]);
};
...
...
@@ -55,7 +54,6 @@ describe('SubscriptionActivationForm', () => {
}
=
{})
=>
{
wrapper
=
extendedWrapper
(
mountMethod
(
SubscriptionActivationForm
,
{
localVue
,
apolloProvider
:
createMockApolloProvider
(
mutationMock
),
propsData
:
{
...
props
,
...
...
spec/frontend/admin/statistics_panel/components/app_spec.js
View file @
fbc0f631
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
AxiosMockAdapter
from
'
axios-mock-adapter
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
StatisticsPanelApp
from
'
~/admin/statistics_panel/components/app.vue
'
;
import
statisticsLabels
from
'
~/admin/statistics_panel/constants
'
;
...
...
@@ -9,8 +10,7 @@ import axios from '~/lib/utils/axios_utils';
import
{
convertObjectPropsToCamelCase
}
from
'
~/lib/utils/common_utils
'
;
import
mockStatistics
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Admin statistics app
'
,
()
=>
{
let
wrapper
;
...
...
@@ -19,7 +19,6 @@ describe('Admin statistics app', () => {
const
createComponent
=
()
=>
{
wrapper
=
shallowMount
(
StatisticsPanelApp
,
{
localVue
,
store
,
});
};
...
...
spec/frontend/admin/users/components/users_table_spec.js
View file @
fbc0f631
import
{
GlTable
,
GlSkeletonLoader
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
VueApollo
from
'
vue-apollo
'
;
import
createMockApollo
from
'
helpers/mock_apollo_helper
'
;
...
...
@@ -16,8 +16,7 @@ import { users, paths, createGroupCountResponse } from '../mock_data';
jest
.
mock
(
'
~/flash
'
);
const
localVue
=
createLocalVue
();
localVue
.
use
(
VueApollo
);
Vue
.
use
(
VueApollo
);
describe
(
'
AdminUsersTable component
'
,
()
=>
{
let
wrapper
;
...
...
@@ -48,7 +47,6 @@ describe('AdminUsersTable component', () => {
const
initComponent
=
(
props
=
{},
resolverMock
=
fetchGroupCountsResponse
)
=>
{
wrapper
=
mountExtended
(
AdminUsersTable
,
{
localVue
,
apolloProvider
:
createMockApolloProvider
(
resolverMock
),
propsData
:
{
users
,
...
...
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