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
e287f845
Commit
e287f845
authored
Dec 09, 2021
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use global Vue instance in Jest (approvals)
parent
8464faa7
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
31 additions
and
44 deletions
+31
-44
ee/spec/frontend/approvals/components/approval_settings_spec.js
...c/frontend/approvals/components/approval_settings_spec.js
+3
-4
ee/spec/frontend/approvals/components/approvers_select_spec.js
...ec/frontend/approvals/components/approvers_select_spec.js
+1
-4
ee/spec/frontend/approvals/components/group_settings/app_spec.js
.../frontend/approvals/components/group_settings/app_spec.js
+3
-4
ee/spec/frontend/approvals/components/license_compliance/index_spec.js
...end/approvals/components/license_compliance/index_spec.js
+3
-4
ee/spec/frontend/approvals/components/license_compliance/modal_spec.js
...end/approvals/components/license_compliance/modal_spec.js
+3
-4
ee/spec/frontend/approvals/components/modal_rule_remove_spec.js
...c/frontend/approvals/components/modal_rule_remove_spec.js
+3
-4
ee/spec/frontend/approvals/components/mr_edit/app_spec.js
ee/spec/frontend/approvals/components/mr_edit/app_spec.js
+3
-4
ee/spec/frontend/approvals/components/mr_edit/rule_input_spec.js
.../frontend/approvals/components/mr_edit/rule_input_spec.js
+3
-4
ee/spec/frontend/approvals/components/rule_name_spec.js
ee/spec/frontend/approvals/components/rule_name_spec.js
+3
-4
ee/spec/frontend/approvals/components/security_configuration/unconfigured_security_rule_spec.js
...security_configuration/unconfigured_security_rule_spec.js
+3
-4
ee/spec/frontend/approvals/components/security_configuration/unconfigured_security_rules_spec.js
...ecurity_configuration/unconfigured_security_rules_spec.js
+3
-4
No files found.
ee/spec/frontend/approvals/components/approval_settings_spec.js
View file @
e287f845
import
{
GlButton
,
GlForm
,
GlLoadingIcon
,
GlLink
}
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
ApprovalSettings
from
'
ee/approvals/components/approval_settings.vue
'
;
...
...
@@ -16,8 +17,7 @@ import waitForPromises from 'helpers/wait_for_promises';
import
{
sprintf
}
from
'
~/locale
'
;
import
{
createGroupApprovalsPayload
,
createGroupApprovalsState
}
from
'
../mocks
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
ApprovalSettings
'
,
()
=>
{
let
wrapper
;
...
...
@@ -44,7 +44,6 @@ describe('ApprovalSettings', () => {
const
createWrapper
=
(
props
=
{})
=>
{
wrapper
=
extendedWrapper
(
shallowMount
(
ApprovalSettings
,
{
localVue
,
store
,
propsData
:
{
approvalSettingsPath
,
...
...
ee/spec/frontend/approvals/components/approvers_select_spec.js
View file @
e287f845
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
$
from
'
jquery
'
;
import
'
select2/select2
'
;
import
Api
from
'
ee/api
'
;
...
...
@@ -24,8 +24,6 @@ const TEST_USERS = [
{
id
:
3
,
name
:
'
Sit
'
,
username
:
'
sit
'
,
avatar_url
:
TEST_USER_AVATAR
},
];
const
localVue
=
createLocalVue
();
const
waitForEvent
=
(
$input
,
event
)
=>
new
Promise
((
resolve
)
=>
$input
.
one
(
event
,
resolve
));
const
parseAvatar
=
(
element
)
=>
element
.
classList
.
contains
(
'
identicon
'
)
?
null
:
element
.
getAttribute
(
'
src
'
);
...
...
@@ -62,7 +60,6 @@ describe('Approvals ApproversSelect', () => {
wrapper
=
await
shallowMount
(
ApproversSelect
,
{
...
options
,
propsData
,
localVue
,
attachTo
:
document
.
body
,
});
...
...
ee/spec/frontend/approvals/components/group_settings/app_spec.js
View file @
e287f845
import
{
GlSprintf
,
GlLink
}
from
'
@gitlab/ui
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
axios
from
'
axios
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
ApprovalSettings
from
'
ee/approvals/components/approval_settings.vue
'
;
...
...
@@ -13,8 +14,7 @@ import approvalSettingsModule from 'ee/approvals/stores/modules/approval_setting
import
{
extendedWrapper
}
from
'
helpers/vue_test_utils_helper
'
;
import
SettingsBlock
from
'
~/vue_shared/components/settings/settings_block.vue
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
EE Approvals Group Settings App
'
,
()
=>
{
let
wrapper
;
...
...
@@ -27,7 +27,6 @@ describe('EE Approvals Group Settings App', () => {
const
createWrapper
=
()
=>
{
wrapper
=
extendedWrapper
(
shallowMount
(
GroupSettingsApp
,
{
localVue
,
store
:
new
Vuex
.
Store
(
store
),
propsData
:
{
defaultExpanded
,
...
...
ee/spec/frontend/approvals/components/license_compliance/index_spec.js
View file @
e287f845
import
{
GlIcon
}
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
LicenseComplianceApprovals
from
'
ee/approvals/components/license_compliance/index.vue
'
;
import
approvalsLicenceComplianceModule
,
{
...
...
@@ -8,8 +9,7 @@ import approvalsLicenceComplianceModule, {
}
from
'
ee/approvals/stores/modules/license_compliance
'
;
import
modalModule
from
'
~/vuex_shared/modules/modal
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
const
TEST_APPROVALS_DOCUMENTATION_PATH
=
'
http://foo.bar
'
;
const
TEST_LOCKED_APPROVALS_RULE_NAME
=
'
License-Check
'
;
...
...
@@ -35,7 +35,6 @@ describe('EE Approvals LicenseCompliance', () => {
const
createWrapper
=
()
=>
{
wrapper
=
mount
(
LicenseComplianceApprovals
,
{
localVue
,
store
:
new
Vuex
.
Store
(
store
),
stubs
:
{
'
rule-form
'
:
true
,
...
...
ee/spec/frontend/approvals/components/license_compliance/modal_spec.js
View file @
e287f845
import
{
GlSprintf
,
GlModal
}
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
LicenseComplianceModal
from
'
ee/approvals/components/license_compliance/modal.vue
'
;
import
{
APPROVALS_MODAL
}
from
'
ee/approvals/stores/modules/license_compliance
'
;
import
GlModalVuex
from
'
~/vue_shared/components/gl_modal_vuex.vue
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
EE Approvals LicenseCompliance Modal
'
,
()
=>
{
let
wrapper
;
...
...
@@ -52,7 +52,6 @@ describe('EE Approvals LicenseCompliance Modal', () => {
const
createWrapper
=
()
=>
{
wrapper
=
shallowMount
(
LicenseComplianceModal
,
{
localVue
,
store
,
stubs
:
{
GlModalVuex
,
...
...
ee/spec/frontend/approvals/components/modal_rule_remove_spec.js
View file @
e287f845
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
ModalRuleRemove
from
'
ee/approvals/components/modal_rule_remove.vue
'
;
import
{
stubComponent
}
from
'
helpers/stub_component
'
;
...
...
@@ -19,8 +20,7 @@ const SINGLE_APPROVER = {
approvers
:
[{
id
:
1
}],
};
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Approvals ModalRuleRemove
'
,
()
=>
{
let
wrapper
;
...
...
@@ -47,7 +47,6 @@ describe('Approvals ModalRuleRemove', () => {
wrapper
=
shallowMount
(
ModalRuleRemove
,
{
...
options
,
localVue
,
store
,
propsData
,
stubs
:
{
...
...
ee/spec/frontend/approvals/components/mr_edit/app_spec.js
View file @
e287f845
import
{
mount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
mount
}
from
'
@vue/test-utils
'
;
import
axios
from
'
axios
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
MREditApp
from
'
ee/approvals/components/mr_edit/app.vue
'
;
import
MRRules
from
'
ee/approvals/components/mr_edit/mr_rules.vue
'
;
...
...
@@ -8,8 +9,7 @@ import MRRulesHiddenInputs from 'ee/approvals/components/mr_edit/mr_rules_hidden
import
{
createStoreOptions
}
from
'
ee/approvals/stores
'
;
import
MREditModule
from
'
ee/approvals/stores/modules/mr_edit
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
EE Approvals MREditApp
'
,
()
=>
{
let
wrapper
;
...
...
@@ -18,7 +18,6 @@ describe('EE Approvals MREditApp', () => {
const
factory
=
(
mrCollapsedApprovalRules
=
false
)
=>
{
wrapper
=
mount
(
MREditApp
,
{
localVue
,
store
:
new
Vuex
.
Store
(
store
),
provide
:
{
glFeatures
:
{
...
...
ee/spec/frontend/approvals/components/mr_edit/rule_input_spec.js
View file @
e287f845
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
RuleInput
from
'
ee/approvals/components/mr_edit/rule_input.vue
'
;
import
{
createStoreOptions
}
from
'
ee/approvals/stores
'
;
import
MREditModule
from
'
ee/approvals/stores/modules/mr_edit
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
Rule Input
'
,
()
=>
{
let
wrapper
;
...
...
@@ -20,7 +20,6 @@ describe('Rule Input', () => {
},
...
props
,
},
localVue
,
store
:
new
Vuex
.
Store
(
store
),
});
};
...
...
ee/spec/frontend/approvals/components/rule_name_spec.js
View file @
e287f845
import
{
GlLink
,
GlPopover
,
GlIcon
}
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
RuleName
from
'
ee/approvals/components/rule_name.vue
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
RuleName component
'
,
()
=>
{
let
wrapper
;
const
createWrapper
=
(
props
=
{})
=>
{
wrapper
=
shallowMount
(
RuleName
,
{
localVue
,
propsData
:
{
...
props
,
},
...
...
ee/spec/frontend/approvals/components/security_configuration/unconfigured_security_rule_spec.js
View file @
e287f845
import
{
GlSprintf
,
GlButton
}
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
UnconfiguredSecurityRule
from
'
ee/approvals/components/security_configuration/unconfigured_security_rule.vue
'
;
import
{
...
...
@@ -8,8 +9,7 @@ import {
COVERAGE_CHECK_NAME
,
}
from
'
ee/approvals/constants
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
UnconfiguredSecurityRule component
'
,
()
=>
{
let
wrapper
;
...
...
@@ -38,7 +38,6 @@ describe('UnconfiguredSecurityRule component', () => {
const
createWrapper
=
(
props
=
{},
options
=
{})
=>
{
wrapper
=
mount
(
UnconfiguredSecurityRule
,
{
localVue
,
propsData
:
{
...
props
,
},
...
...
ee/spec/frontend/approvals/components/security_configuration/unconfigured_security_rules_spec.js
View file @
e287f845
import
{
GlDeprecatedSkeletonLoading
as
GlSkeletonLoading
}
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
UnconfiguredSecurityRule
from
'
ee/approvals/components/security_configuration/unconfigured_security_rule.vue
'
;
import
UnconfiguredSecurityRules
from
'
ee/approvals/components/security_configuration/unconfigured_security_rules.vue
'
;
import
{
createStoreOptions
}
from
'
ee/approvals/stores
'
;
import
projectSettingsModule
from
'
ee/approvals/stores/modules/project_settings
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
Vue
.
use
(
Vuex
);
describe
(
'
UnconfiguredSecurityRules component
'
,
()
=>
{
let
wrapper
;
...
...
@@ -17,7 +17,6 @@ describe('UnconfiguredSecurityRules component', () => {
const
createWrapper
=
(
props
=
{})
=>
{
wrapper
=
shallowMount
(
UnconfiguredSecurityRules
,
{
localVue
,
store
,
propsData
:
{
...
props
,
...
...
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