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
24574e32
Commit
24574e32
authored
Nov 11, 2019
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate feature flags table specs to Jest
Migrated feature_flags_table_spec.js from Karma to Jest
parent
57f016b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
68 deletions
+66
-68
ee/spec/frontend/feature_flags/components/feature_flags_table_spec.js
...tend/feature_flags/components/feature_flags_table_spec.js
+66
-68
No files found.
ee/spec/
javascripts
/feature_flags/components/feature_flags_table_spec.js
→
ee/spec/
frontend
/feature_flags/components/feature_flags_table_spec.js
View file @
24574e32
import
featureFlagsTableComponent
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
{
createLocalVue
,
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
trimText
}
from
'
spec/
helpers/text_helper
'
;
import
{
trimText
}
from
'
helpers/text_helper
'
;
import
{
import
{
ROLLOUT_STRATEGY_ALL_USERS
,
ROLLOUT_STRATEGY_ALL_USERS
,
ROLLOUT_STRATEGY_PERCENT_ROLLOUT
,
ROLLOUT_STRATEGY_PERCENT_ROLLOUT
,
...
@@ -10,21 +10,26 @@ import {
...
@@ -10,21 +10,26 @@ import {
const
localVue
=
createLocalVue
();
const
localVue
=
createLocalVue
();
describe
(
'
Feature flag table
'
,
()
=>
{
describe
(
'
Feature flag table
'
,
()
=>
{
let
Component
;
let
wrapper
;
let
wrapper
;
const
createWrapper
=
(
propsData
,
opts
=
{})
=>
{
wrapper
=
shallowMount
(
FeatureFlagsTable
,
{
propsData
,
sync
:
false
,
localVue
,
...
opts
,
});
};
afterEach
(()
=>
{
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
.
destroy
();
wrapper
=
null
;
});
});
describe
(
'
with an active scope and a standard rollout strategy
'
,
()
=>
{
describe
(
'
with an active scope and a standard rollout strategy
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
Component
=
localVue
.
extend
(
featureFlagsTableComponent
);
createWrapper
(
{
wrapper
=
shallowMount
(
Component
,
{
localVue
,
provide
:
{
glFeatures
:
{
featureFlagIID
:
true
}
},
propsData
:
{
featureFlags
:
[
featureFlags
:
[
{
{
id
:
1
,
id
:
1
,
...
@@ -50,7 +55,10 @@ describe('Feature flag table', () => {
...
@@ -50,7 +55,10 @@ describe('Feature flag table', () => {
],
],
csrfToken
:
'
fakeToken
'
,
csrfToken
:
'
fakeToken
'
,
},
},
});
{
provide
:
{
glFeatures
:
{
featureFlagIID
:
true
}
},
},
);
});
});
it
(
'
Should render a table
'
,
()
=>
{
it
(
'
Should render a table
'
,
()
=>
{
...
@@ -103,35 +111,30 @@ describe('Feature flag table', () => {
...
@@ -103,35 +111,30 @@ describe('Feature flag table', () => {
describe
(
'
with an active scope and a percentage rollout strategy
'
,
()
=>
{
describe
(
'
with an active scope and a percentage rollout strategy
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
Component
=
localVue
.
extend
(
featureFlagsTableComponent
);
createWrapper
({
featureFlags
:
[
wrapper
=
shallowMount
(
Component
,
{
{
localVue
,
id
:
1
,
propsData
:
{
active
:
true
,
featureFlags
:
[
name
:
'
flag name
'
,
{
description
:
'
flag description
'
,
id
:
1
,
destroy_path
:
'
destroy/path
'
,
active
:
true
,
edit_path
:
'
edit/path
'
,
name
:
'
flag name
'
,
scopes
:
[
description
:
'
flag description
'
,
{
destroy_path
:
'
destroy/path
'
,
id
:
1
,
edit_path
:
'
edit/path
'
,
active
:
true
,
scopes
:
[
environmentScope
:
'
scope
'
,
{
canUpdate
:
true
,
id
:
1
,
protected
:
false
,
active
:
true
,
rolloutStrategy
:
ROLLOUT_STRATEGY_PERCENT_ROLLOUT
,
environmentScope
:
'
scope
'
,
rolloutPercentage
:
'
54
'
,
canUpdate
:
true
,
shouldBeDestroyed
:
false
,
protected
:
false
,
},
rolloutStrategy
:
ROLLOUT_STRATEGY_PERCENT_ROLLOUT
,
],
rolloutPercentage
:
'
54
'
,
},
shouldBeDestroyed
:
false
,
],
},
csrfToken
:
'
fakeToken
'
,
],
},
],
csrfToken
:
'
fakeToken
'
,
},
});
});
});
});
...
@@ -144,35 +147,30 @@ describe('Feature flag table', () => {
...
@@ -144,35 +147,30 @@ describe('Feature flag table', () => {
describe
(
'
with an inactive scope
'
,
()
=>
{
describe
(
'
with an inactive scope
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
Component
=
localVue
.
extend
(
featureFlagsTableComponent
);
createWrapper
({
featureFlags
:
[
wrapper
=
shallowMount
(
Component
,
{
{
localVue
,
id
:
1
,
propsData
:
{
active
:
true
,
featureFlags
:
[
name
:
'
flag name
'
,
{
description
:
'
flag description
'
,
id
:
1
,
destroy_path
:
'
destroy/path
'
,
active
:
true
,
edit_path
:
'
edit/path
'
,
name
:
'
flag name
'
,
scopes
:
[
description
:
'
flag description
'
,
{
destroy_path
:
'
destroy/path
'
,
id
:
1
,
edit_path
:
'
edit/path
'
,
active
:
false
,
scopes
:
[
environmentScope
:
'
scope
'
,
{
canUpdate
:
true
,
id
:
1
,
protected
:
false
,
active
:
false
,
rolloutStrategy
:
ROLLOUT_STRATEGY_ALL_USERS
,
environmentScope
:
'
scope
'
,
rolloutPercentage
:
DEFAULT_PERCENT_ROLLOUT
,
canUpdate
:
true
,
shouldBeDestroyed
:
false
,
protected
:
false
,
},
rolloutStrategy
:
ROLLOUT_STRATEGY_ALL_USERS
,
],
rolloutPercentage
:
DEFAULT_PERCENT_ROLLOUT
,
},
shouldBeDestroyed
:
false
,
],
},
csrfToken
:
'
fakeToken
'
,
],
},
],
csrfToken
:
'
fakeToken
'
,
},
});
});
});
});
...
...
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