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
ee614685
Commit
ee614685
authored
Apr 21, 2021
by
Sarah GP
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for this case
parent
2376a5ee
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue
...ts/pipelines/components/graph/graph_component_wrapper.vue
+6
-2
spec/frontend/pipelines/graph/graph_component_wrapper_spec.js
.../frontend/pipelines/graph/graph_component_wrapper_spec.js
+30
-0
No files found.
app/assets/javascripts/pipelines/components/graph/graph_component_wrapper.vue
View file @
ee614685
...
...
@@ -138,6 +138,10 @@ export default {
metricsPath
:
this
.
metricsPath
,
};
},
graphViewType
()
{
/* This prevents reading view type off the localStorage value if it does not apply. */
return
this
.
showGraphViewSelector
?
this
.
currentViewType
:
STAGE_VIEW
;
},
showLoadingIcon
()
{
/*
Shows the icon only when the graph is empty, not when it is is
...
...
@@ -205,7 +209,7 @@ export default {
>
<graph-view-selector
v-if=
"showGraphViewSelector"
:type=
"
current
ViewType"
:type=
"
graph
ViewType"
:show-links=
"showLinks"
@
updateViewType=
"updateViewType"
@
updateShowLinksState=
"updateShowLinksState"
...
...
@@ -218,7 +222,7 @@ export default {
:pipeline=
"pipeline"
:pipeline-layers=
"getPipelineLayers()"
:show-links=
"showLinks"
:view-type=
"
current
ViewType"
:view-type=
"
graph
ViewType"
@
error=
"reportFailure"
@
refreshPipelineGraph=
"refreshPipelineGraph"
/>
...
...
spec/frontend/pipelines/graph/graph_component_wrapper_spec.js
View file @
ee614685
...
...
@@ -354,6 +354,36 @@ describe('Pipeline graph wrapper', () => {
});
});
describe
(
'
when feature flag is on and local storage is set, but the graph does not use needs
'
,
()
=>
{
beforeEach
(
async
()
=>
{
const
nonNeedsResponse
=
{
...
mockPipelineResponse
};
nonNeedsResponse
.
data
.
project
.
pipeline
.
usesNeeds
=
false
;
localStorage
.
setItem
(
VIEW_TYPE_KEY
,
LAYER_VIEW
);
createComponentWithApollo
({
provide
:
{
glFeatures
:
{
pipelineGraphLayersView
:
true
,
},
},
mountFn
:
mount
,
getPipelineDetailsHandler
:
jest
.
fn
().
mockResolvedValue
(
nonNeedsResponse
),
});
jest
.
runOnlyPendingTimers
();
await
wrapper
.
vm
.
$nextTick
();
});
afterEach
(()
=>
{
localStorage
.
clear
();
});
it
(
'
still passes stage type to graph
'
,
()
=>
{
expect
(
getGraph
().
props
(
'
viewType
'
)).
toBe
(
STAGE_VIEW
);
});
});
describe
(
'
when feature flag is on but pipeline does not use needs
'
,
()
=>
{
beforeEach
(
async
()
=>
{
const
nonNeedsResponse
=
{
...
mockPipelineResponse
};
...
...
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