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
69cb7a22
Commit
69cb7a22
authored
Dec 19, 2019
by
Andrew Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove localVue Usage from Feature Flag Tests
They aren't being used, and aren't necessary in Jest.
parent
858555fa
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
29 deletions
+9
-29
ee/spec/frontend/feature_flags/components/configure_feature_flags_modal_spec.js
...re_flags/components/configure_feature_flags_modal_spec.js
+2
-6
ee/spec/frontend/feature_flags/components/environments_dropdown_spec.js
...nd/feature_flags/components/environments_dropdown_spec.js
+1
-4
ee/spec/frontend/feature_flags/components/feature_flags_spec.js
...c/frontend/feature_flags/components/feature_flags_spec.js
+3
-6
ee/spec/frontend/feature_flags/components/feature_flags_table_spec.js
...tend/feature_flags/components/feature_flags_table_spec.js
+1
-4
ee/spec/frontend/feature_flags/components/form_spec.js
ee/spec/frontend/feature_flags/components/form_spec.js
+1
-4
ee/spec/frontend/feature_flags/components/new_feature_flag_spec.js
...rontend/feature_flags/components/new_feature_flag_spec.js
+1
-5
No files found.
ee/spec/frontend/feature_flags/components/configure_feature_flags_modal_spec.js
View file @
69cb7a22
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlButton
}
from
'
@gitlab/ui
'
;
import
component
from
'
ee/feature_flags/components/configure_feature_flags_modal.vue
'
;
import
Component
from
'
ee/feature_flags/components/configure_feature_flags_modal.vue
'
;
const
localVue
=
createLocalVue
();
describe
(
'
Configure Feature Flags Modal
'
,
()
=>
{
describe
(
'
Configure Feature Flags Modal
'
,
()
=>
{
const
Component
=
localVue
.
extend
(
component
);
let
wrapper
;
let
wrapper
;
let
propsData
;
let
propsData
;
...
@@ -24,7 +21,6 @@ describe('Configure Feature Flags Modal', () => {
...
@@ -24,7 +21,6 @@ describe('Configure Feature Flags Modal', () => {
wrapper
=
shallowMount
(
Component
,
{
wrapper
=
shallowMount
(
Component
,
{
propsData
,
propsData
,
localVue
,
sync
:
false
,
sync
:
false
,
attachToDocument
:
true
,
attachToDocument
:
true
,
});
});
...
...
ee/spec/frontend/feature_flags/components/environments_dropdown_spec.js
View file @
69cb7a22
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlLoadingIcon
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlButton
}
from
'
@gitlab/ui
'
;
import
EnvironmentsDropdown
from
'
ee/feature_flags/components/environments_dropdown.vue
'
;
import
EnvironmentsDropdown
from
'
ee/feature_flags/components/environments_dropdown.vue
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
const
localVue
=
createLocalVue
();
describe
(
'
Feature flags > Environments dropdown
'
,
()
=>
{
describe
(
'
Feature flags > Environments dropdown
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
let
mock
;
let
mock
;
const
factory
=
props
=>
{
const
factory
=
props
=>
{
wrapper
=
shallowMount
(
EnvironmentsDropdown
,
{
wrapper
=
shallowMount
(
EnvironmentsDropdown
,
{
localVue
,
propsData
:
{
propsData
:
{
endpoint
:
`
${
TEST_HOST
}
/environments.json'`
,
endpoint
:
`
${
TEST_HOST
}
/environments.json'`
,
...
props
,
...
props
,
...
...
ee/spec/frontend/feature_flags/components/feature_flags_spec.js
View file @
69cb7a22
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
{
GlEmptyState
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlEmptyState
,
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
store
from
'
ee/feature_flags/store
'
;
import
store
from
'
ee/feature_flags/store
'
;
...
@@ -11,8 +11,6 @@ import TablePagination from '~/vue_shared/components/pagination/table_pagination
...
@@ -11,8 +11,6 @@ import TablePagination from '~/vue_shared/components/pagination/table_pagination
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
{
getRequestData
}
from
'
../mock_data
'
;
import
{
getRequestData
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
describe
(
'
Feature flags
'
,
()
=>
{
describe
(
'
Feature flags
'
,
()
=>
{
const
mockData
=
{
const
mockData
=
{
endpoint
:
`
${
TEST_HOST
}
/endpoint.json`
,
endpoint
:
`
${
TEST_HOST
}
/endpoint.json`
,
...
@@ -32,7 +30,6 @@ describe('Feature flags', () => {
...
@@ -32,7 +30,6 @@ describe('Feature flags', () => {
const
factory
=
(
propsData
=
mockData
)
=>
{
const
factory
=
(
propsData
=
mockData
)
=>
{
wrapper
=
shallowMount
(
FeatureFlagsComponent
,
{
wrapper
=
shallowMount
(
FeatureFlagsComponent
,
{
localVue
,
propsData
,
propsData
,
sync
:
false
,
sync
:
false
,
});
});
...
@@ -148,7 +145,7 @@ describe('Feature flags', () => {
...
@@ -148,7 +145,7 @@ describe('Feature flags', () => {
it
(
'
renders disabled title
'
,
()
=>
{
it
(
'
renders disabled title
'
,
()
=>
{
wrapper
.
setData
({
scope
:
'
disabled
'
});
wrapper
.
setData
({
scope
:
'
disabled
'
});
return
localVue
.
nextTick
(()
=>
{
return
wrapper
.
vm
.
$
nextTick
(()
=>
{
expect
(
emptyState
.
props
(
'
title
'
)).
toEqual
(
'
There are no inactive feature flags
'
);
expect
(
emptyState
.
props
(
'
title
'
)).
toEqual
(
'
There are no inactive feature flags
'
);
});
});
});
});
...
@@ -158,7 +155,7 @@ describe('Feature flags', () => {
...
@@ -158,7 +155,7 @@ describe('Feature flags', () => {
it
(
'
renders enabled title
'
,
()
=>
{
it
(
'
renders enabled title
'
,
()
=>
{
wrapper
.
setData
({
scope
:
'
enabled
'
});
wrapper
.
setData
({
scope
:
'
enabled
'
});
localVue
.
nextTick
(()
=>
{
wrapper
.
vm
.
$
nextTick
(()
=>
{
expect
(
emptyState
.
props
(
'
title
'
)).
toEqual
(
'
There are no active feature flags
'
);
expect
(
emptyState
.
props
(
'
title
'
)).
toEqual
(
'
There are no active feature flags
'
);
});
});
});
});
...
...
ee/spec/frontend/feature_flags/components/feature_flags_table_spec.js
View file @
69cb7a22
import
FeatureFlagsTable
from
'
ee/feature_flags/components/feature_flags_table.vue
'
;
import
FeatureFlagsTable
from
'
ee/feature_flags/components/feature_flags_table.vue
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlToggle
}
from
'
@gitlab/ui
'
;
import
{
GlToggle
}
from
'
@gitlab/ui
'
;
import
{
trimText
}
from
'
helpers/text_helper
'
;
import
{
trimText
}
from
'
helpers/text_helper
'
;
import
{
import
{
...
@@ -8,8 +8,6 @@ import {
...
@@ -8,8 +8,6 @@ import {
DEFAULT_PERCENT_ROLLOUT
,
DEFAULT_PERCENT_ROLLOUT
,
}
from
'
ee/feature_flags/constants
'
;
}
from
'
ee/feature_flags/constants
'
;
const
localVue
=
createLocalVue
();
const
getDefaultProps
=
()
=>
({
const
getDefaultProps
=
()
=>
({
featureFlags
:
[
featureFlags
:
[
{
{
...
@@ -44,7 +42,6 @@ describe('Feature flag table', () => {
...
@@ -44,7 +42,6 @@ describe('Feature flag table', () => {
wrapper
=
shallowMount
(
FeatureFlagsTable
,
{
wrapper
=
shallowMount
(
FeatureFlagsTable
,
{
propsData
,
propsData
,
sync
:
false
,
sync
:
false
,
localVue
,
...
opts
,
...
opts
,
});
});
};
};
...
...
ee/spec/frontend/feature_flags/components/form_spec.js
View file @
69cb7a22
import
_
from
'
underscore
'
;
import
_
from
'
underscore
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlFormTextarea
,
GlFormCheckbox
}
from
'
@gitlab/ui
'
;
import
{
GlFormTextarea
,
GlFormCheckbox
}
from
'
@gitlab/ui
'
;
import
Form
from
'
ee/feature_flags/components/form.vue
'
;
import
Form
from
'
ee/feature_flags/components/form.vue
'
;
import
EnvironmentsDropdown
from
'
ee/feature_flags/components/environments_dropdown.vue
'
;
import
EnvironmentsDropdown
from
'
ee/feature_flags/components/environments_dropdown.vue
'
;
...
@@ -31,10 +31,7 @@ describe('feature flag form', () => {
...
@@ -31,10 +31,7 @@ describe('feature flag form', () => {
});
});
const
factory
=
(
props
=
{})
=>
{
const
factory
=
(
props
=
{})
=>
{
const
localVue
=
createLocalVue
();
wrapper
=
shallowMount
(
Form
,
{
wrapper
=
shallowMount
(
Form
,
{
localVue
,
propsData
:
props
,
propsData
:
props
,
provide
:
{
provide
:
{
glFeatures
:
{
glFeatures
:
{
...
...
ee/spec/frontend/feature_flags/components/new_feature_flag_spec.js
View file @
69cb7a22
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Form
from
'
ee/feature_flags/components/form.vue
'
;
import
Form
from
'
ee/feature_flags/components/form.vue
'
;
import
newModule
from
'
ee/feature_flags/store/modules/new
'
;
import
newModule
from
'
ee/feature_flags/store/modules/new
'
;
import
NewFeatureFlag
from
'
ee/feature_flags/components/new_feature_flag.vue
'
;
import
NewFeatureFlag
from
'
ee/feature_flags/components/new_feature_flag.vue
'
;
import
{
ROLLOUT_STRATEGY_ALL_USERS
,
DEFAULT_PERCENT_ROLLOUT
}
from
'
ee/feature_flags/constants
'
;
import
{
ROLLOUT_STRATEGY_ALL_USERS
,
DEFAULT_PERCENT_ROLLOUT
}
from
'
ee/feature_flags/constants
'
;
const
localVue
=
createLocalVue
();
localVue
.
use
(
Vuex
);
describe
(
'
New feature flag form
'
,
()
=>
{
describe
(
'
New feature flag form
'
,
()
=>
{
let
wrapper
;
let
wrapper
;
...
@@ -19,7 +16,6 @@ describe('New feature flag form', () => {
...
@@ -19,7 +16,6 @@ describe('New feature flag form', () => {
const
factory
=
()
=>
{
const
factory
=
()
=>
{
wrapper
=
shallowMount
(
NewFeatureFlag
,
{
wrapper
=
shallowMount
(
NewFeatureFlag
,
{
localVue
,
propsData
:
{
propsData
:
{
endpoint
:
'
feature_flags.json
'
,
endpoint
:
'
feature_flags.json
'
,
path
:
'
/feature_flags
'
,
path
:
'
/feature_flags
'
,
...
...
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