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
cc93dbef
Commit
cc93dbef
authored
May 11, 2021
by
Rajat Jain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests header component
parent
72171edd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
ee/app/assets/javascripts/related_items_tree/components/related_items_tree_header.vue
...lated_items_tree/components/related_items_tree_header.vue
+3
-3
ee/spec/frontend/related_items_tree/components/related_items_tree_header_spec.js
...d_items_tree/components/related_items_tree_header_spec.js
+23
-0
No files found.
ee/app/assets/javascripts/related_items_tree/components/related_items_tree_header.vue
View file @
cc93dbef
...
...
@@ -76,7 +76,7 @@ export default {
<gl-tooltip
:target=
"() => $refs.countBadge"
>
<p
v-if=
"allowSubEpics"
class=
"font-weight-bold m-0"
>
{{
__
(
'
Epics
'
)
}}
•
<span
class=
"
text-secondary-400
font-weight-normal"
<span
class=
"font-weight-normal"
>
{{
sprintf
(
__
(
'
%{openedEpics
}
open, %{closedEpics
}
closed
'
),
{
openedEpics
:
descendantCounts
.
openedEpics
,
...
...
@@ -87,7 +87,7 @@ export default {
<
/p
>
<
p
class
=
"
font-weight-bold m-0
"
>
{{
__
(
'
Issues
'
)
}}
&
#
8226
;
<
span
class
=
"
text-secondary-400
font-weight-normal
"
<
span
class
=
"
font-weight-normal
"
>
{{
sprintf
(
__
(
'
%{openedIssues
}
open, %{closedIssues
}
closed
'
),
{
openedIssues
:
descendantCounts
.
openedIssues
,
...
...
@@ -98,7 +98,7 @@ export default {
<
/p
>
<
p
class
=
"
font-weight-bold m-0
"
>
{{
__
(
'
Total weight
'
)
}}
&
#
8226
;
<
span
class
=
"
text-secondary-400
font-weight-normal
"
>
{{
totalWeight
}}
<
/span
>
<
span
class
=
"
font-weight-normal
"
>
{{
totalWeight
}}
<
/span
>
<
/p
>
<
/gl-tooltip
>
<
div
...
...
ee/spec/frontend/related_items_tree/components/related_items_tree_header_spec.js
View file @
cc93dbef
...
...
@@ -29,6 +29,10 @@ const createComponent = ({ slots } = {}) => {
isSubItem
:
false
,
children
,
});
store
.
dispatch
(
'
setWeightSum
'
,
{
openedIssues
:
10
,
closedIssues
:
5
,
});
store
.
dispatch
(
'
setChildrenCount
'
,
mockParentItem
.
descendantCounts
);
return
shallowMount
(
RelatedItemsTreeHeader
,
{
...
...
@@ -64,6 +68,16 @@ describe('RelatedItemsTree', () => {
});
});
describe
(
'
totalWeight
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
();
});
it
(
'
total of openedIssues and closedIssues weight
'
,
()
=>
{
expect
(
wrapper
.
vm
.
totalWeight
).
toBe
(
15
);
});
});
describe
(
'
epic issue actions split button
'
,
()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
();
...
...
@@ -235,6 +249,15 @@ describe('RelatedItemsTree', () => {
expect
(
issueIcon
.
isVisible
()).
toBe
(
true
);
expect
(
issueIcon
.
props
(
'
name
'
)).
toBe
(
'
issues
'
);
});
it
(
'
renders totalWeight count and gl-icon
'
,
()
=>
{
const
weightEl
=
wrapper
.
findAll
(
'
.issue-count-badge > span
'
).
at
(
2
);
const
weightIcon
=
weightEl
.
find
(
GlIcon
);
expect
(
weightEl
.
text
().
trim
()).
toContain
(
'
15
'
);
expect
(
weightIcon
.
isVisible
()).
toBe
(
true
);
expect
(
weightIcon
.
props
(
'
name
'
)).
toBe
(
'
weight
'
);
});
});
});
});
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