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
5120a8a1
Commit
5120a8a1
authored
Aug 07, 2020
by
Jake Lear
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec for iteration sidebar link
parent
019bf2e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
ee/app/assets/javascripts/sidebar/components/iteration_select.vue
...ssets/javascripts/sidebar/components/iteration_select.vue
+5
-3
ee/spec/frontend/sidebar/components/iteration_select_spec.js
ee/spec/frontend/sidebar/components/iteration_select_spec.js
+12
-1
No files found.
ee/app/assets/javascripts/sidebar/components/iteration_select.vue
View file @
5120a8a1
...
...
@@ -90,12 +90,14 @@ export default {
};
},
computed
:
{
iteration
()
{
return
this
.
iterations
.
find
(({
id
})
=>
id
===
this
.
currentIteration
);
},
iterationTitle
()
{
// NOTE: Optional chaining guards when search result is empty
return
this
.
iterations
.
find
(({
id
})
=>
id
===
this
.
currentIteration
)?.
title
;
return
this
.
iteration
?.
title
;
},
iterationUrl
()
{
return
this
.
iteration
s
.
find
(({
id
})
=>
id
===
this
.
currentIteration
)
?.
webUrl
;
return
this
.
iteration
?.
webUrl
;
},
showNoIterationContent
()
{
return
!
this
.
editing
&&
!
this
.
currentIteration
;
...
...
ee/spec/frontend/sidebar/components/iteration_select_spec.js
View file @
5120a8a1
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlNewDropdown
,
GlNewDropdownItem
,
GlButton
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
import
{
GlNewDropdown
,
GlNewDropdownItem
,
GlButton
,
Gl
Link
,
Gl
SearchBoxByType
}
from
'
@gitlab/ui
'
;
import
createFlash
from
'
~/flash
'
;
import
IterationSelect
from
'
ee/sidebar/components/iteration_select.vue
'
;
import
{
iterationSelectTextMap
}
from
'
ee/sidebar/constants
'
;
...
...
@@ -63,6 +63,17 @@ describe('IterationSelect', () => {
expect
(
wrapper
.
find
(
'
[data-testid="select-iteration"]
'
).
text
()).
toBe
(
'
title
'
);
});
it
(
'
links to the current iteration
'
,
()
=>
{
createComponent
({
data
:
{
iterations
:
[{
id
:
'
id
'
,
title
:
'
title
'
,
webUrl
:
'
webUrl
'
}],
currentIteration
:
'
id
'
,
},
});
expect
(
wrapper
.
find
(
GlLink
).
attributes
().
href
).
toBe
(
'
webUrl
'
);
});
});
describe
(
'
when a user cannot edit
'
,
()
=>
{
...
...
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