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
1301ac5c
Commit
1301ac5c
authored
Sep 24, 2020
by
Ezekiel Kigbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor re-organize base_spec file
Minor refactor for the VSA base spec file to reduce nesting
parent
0ab6f96b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
278 additions
and
283 deletions
+278
-283
ee/spec/frontend/analytics/cycle_analytics/components/base_spec.js
...rontend/analytics/cycle_analytics/components/base_spec.js
+278
-283
No files found.
ee/spec/frontend/analytics/cycle_analytics/components/base_spec.js
View file @
1301ac5c
...
...
@@ -191,7 +191,6 @@ describe('Cycle Analytics component', () => {
expect
(
wrapper
.
find
(
ValueStreamSelect
).
exists
()).
toBe
(
flag
);
};
describe
(
'
displays the components as required
'
,
()
=>
{
describe
(
'
without a group
'
,
()
=>
{
beforeEach
(
async
()
=>
{
const
{
group
,
...
stateWithoutGroup
}
=
initialCycleAnalyticsState
;
...
...
@@ -250,21 +249,88 @@ describe('Cycle Analytics component', () => {
});
});
describe
(
'
with a
group
'
,
()
=>
{
describe
(
'
the user does not have access to the
group
'
,
()
=>
{
beforeEach
(
async
()
=>
{
mock
=
new
MockAdapter
(
axios
);
mockRequiredRoutes
(
mock
);
wrapper
=
await
createComponent
({
featureFlags
:
{
hasPathNavigation
:
true
,
},
});
await
store
.
dispatch
(
'
receiveCycleAnalyticsDataError
'
,
{
response
:
{
status
:
httpStatusCodes
.
FORBIDDEN
},
});
});
it
(
'
renders the no access information
'
,
()
=>
{
const
emptyState
=
wrapper
.
find
(
GlEmptyState
);
expect
(
emptyState
.
exists
()).
toBe
(
true
);
expect
(
emptyState
.
props
(
'
svgPath
'
)).
toBe
(
noAccessSvgPath
);
});
it
(
'
does not display the projects filter
'
,
()
=>
{
displaysProjectsDropdownFilter
(
false
);
});
it
(
'
does not display the date range picker
'
,
()
=>
{
displaysDateRangePicker
(
false
);
});
it
(
'
does not display the metrics
'
,
()
=>
{
displaysMetrics
(
false
);
});
it
(
'
does not display the stage table
'
,
()
=>
{
displaysStageTable
(
false
);
});
it
(
'
does not display the add stage button
'
,
()
=>
{
displaysAddStageButton
(
false
);
});
it
(
'
does not display the tasks by type chart
'
,
()
=>
{
displaysTypeOfWork
(
false
);
});
it
(
'
does not display the duration chart
'
,
()
=>
{
displaysDurationChart
(
false
);
});
describe
(
'
path navigation
'
,
()
=>
{
describe
(
'
disabled
'
,
()
=>
{
it
(
'
does not display the path navigation
'
,
()
=>
{
displaysPathNavigation
(
false
);
});
});
describe
(
'
enabled
'
,
()
=>
{
beforeEach
(
async
()
=>
{
wrapper
=
await
createComponent
({
withValueStreamSelected
:
false
,
withStageSelected
:
true
,
pathNavigationEnabled
:
true
,
});
mock
=
new
MockAdapter
(
axios
);
mockRequiredRoutes
(
mock
);
mock
.
onAny
().
reply
(
httpStatusCodes
.
FORBIDDEN
);
await
waitForPromises
();
});
afterEach
(()
=>
{
wrapper
.
destroy
();
mock
.
restore
();
wrapper
=
null
;
});
it
(
'
does not display the path navigation
'
,
()
=>
{
displaysPathNavigation
(
false
);
});
});
});
});
describe
(
'
the user has access to the group
'
,
()
=>
{
...
...
@@ -279,6 +345,12 @@ describe('Cycle Analytics component', () => {
});
});
afterEach
(()
=>
{
wrapper
.
destroy
();
mock
.
restore
();
wrapper
=
null
;
});
it
(
'
hides the empty state
'
,
()
=>
{
expect
(
wrapper
.
find
(
GlEmptyState
).
exists
()).
toBe
(
false
);
});
...
...
@@ -467,83 +539,6 @@ describe('Cycle Analytics component', () => {
});
});
});
describe
(
'
the user does not have access to the group
'
,
()
=>
{
beforeEach
(
async
()
=>
{
await
store
.
dispatch
(
'
receiveCycleAnalyticsDataError
'
,
{
response
:
{
status
:
httpStatusCodes
.
FORBIDDEN
},
});
});
it
(
'
renders the no access information
'
,
()
=>
{
const
emptyState
=
wrapper
.
find
(
GlEmptyState
);
expect
(
emptyState
.
exists
()).
toBe
(
true
);
expect
(
emptyState
.
props
(
'
svgPath
'
)).
toBe
(
noAccessSvgPath
);
});
it
(
'
does not display the projects filter
'
,
()
=>
{
displaysProjectsDropdownFilter
(
false
);
});
it
(
'
does not display the date range picker
'
,
()
=>
{
displaysDateRangePicker
(
false
);
});
it
(
'
does not display the metrics
'
,
()
=>
{
displaysMetrics
(
false
);
});
it
(
'
does not display the stage table
'
,
()
=>
{
displaysStageTable
(
false
);
});
it
(
'
does not display the add stage button
'
,
()
=>
{
displaysAddStageButton
(
false
);
});
it
(
'
does not display the tasks by type chart
'
,
()
=>
{
displaysTypeOfWork
(
false
);
});
it
(
'
does not display the duration chart
'
,
()
=>
{
displaysDurationChart
(
false
);
});
describe
(
'
path navigation
'
,
()
=>
{
describe
(
'
disabled
'
,
()
=>
{
it
(
'
does not display the path navigation
'
,
()
=>
{
displaysPathNavigation
(
false
);
});
});
describe
(
'
enabled
'
,
()
=>
{
beforeEach
(
async
()
=>
{
wrapper
=
await
createComponent
({
withValueStreamSelected
:
false
,
withStageSelected
:
true
,
pathNavigationEnabled
:
true
,
});
mock
=
new
MockAdapter
(
axios
);
mockRequiredRoutes
(
mock
);
mock
.
onAny
().
reply
(
httpStatusCodes
.
FORBIDDEN
);
await
waitForPromises
();
});
afterEach
(()
=>
{
mock
.
restore
();
});
it
(
'
does not display the path navigation
'
,
()
=>
{
displaysPathNavigation
(
false
);
});
});
});
});
});
});
});
describe
(
'
with failed requests while loading
'
,
()
=>
{
...
...
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