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 {
...
@@ -76,7 +76,7 @@ export default {
<gl-tooltip
:target=
"() => $refs.countBadge"
>
<gl-tooltip
:target=
"() => $refs.countBadge"
>
<p
v-if=
"allowSubEpics"
class=
"font-weight-bold m-0"
>
<p
v-if=
"allowSubEpics"
class=
"font-weight-bold m-0"
>
{{
__
(
'
Epics
'
)
}}
•
{{
__
(
'
Epics
'
)
}}
•
<span
class=
"
text-secondary-400
font-weight-normal"
<span
class=
"font-weight-normal"
>
{{
>
{{
sprintf
(
__
(
'
%{openedEpics
}
open, %{closedEpics
}
closed
'
),
{
sprintf
(
__
(
'
%{openedEpics
}
open, %{closedEpics
}
closed
'
),
{
openedEpics
:
descendantCounts
.
openedEpics
,
openedEpics
:
descendantCounts
.
openedEpics
,
...
@@ -87,7 +87,7 @@ export default {
...
@@ -87,7 +87,7 @@ export default {
<
/p
>
<
/p
>
<
p
class
=
"
font-weight-bold m-0
"
>
<
p
class
=
"
font-weight-bold m-0
"
>
{{
__
(
'
Issues
'
)
}}
&
#
8226
;
{{
__
(
'
Issues
'
)
}}
&
#
8226
;
<
span
class
=
"
text-secondary-400
font-weight-normal
"
<
span
class
=
"
font-weight-normal
"
>
{{
>
{{
sprintf
(
__
(
'
%{openedIssues
}
open, %{closedIssues
}
closed
'
),
{
sprintf
(
__
(
'
%{openedIssues
}
open, %{closedIssues
}
closed
'
),
{
openedIssues
:
descendantCounts
.
openedIssues
,
openedIssues
:
descendantCounts
.
openedIssues
,
...
@@ -98,7 +98,7 @@ export default {
...
@@ -98,7 +98,7 @@ export default {
<
/p
>
<
/p
>
<
p
class
=
"
font-weight-bold m-0
"
>
<
p
class
=
"
font-weight-bold m-0
"
>
{{
__
(
'
Total weight
'
)
}}
&
#
8226
;
{{
__
(
'
Total weight
'
)
}}
&
#
8226
;
<
span
class
=
"
text-secondary-400
font-weight-normal
"
>
{{
totalWeight
}}
<
/span
>
<
span
class
=
"
font-weight-normal
"
>
{{
totalWeight
}}
<
/span
>
<
/p
>
<
/p
>
<
/gl-tooltip
>
<
/gl-tooltip
>
<
div
<
div
...
...
ee/spec/frontend/related_items_tree/components/related_items_tree_header_spec.js
View file @
cc93dbef
...
@@ -29,6 +29,10 @@ const createComponent = ({ slots } = {}) => {
...
@@ -29,6 +29,10 @@ const createComponent = ({ slots } = {}) => {
isSubItem
:
false
,
isSubItem
:
false
,
children
,
children
,
});
});
store
.
dispatch
(
'
setWeightSum
'
,
{
openedIssues
:
10
,
closedIssues
:
5
,
});
store
.
dispatch
(
'
setChildrenCount
'
,
mockParentItem
.
descendantCounts
);
store
.
dispatch
(
'
setChildrenCount
'
,
mockParentItem
.
descendantCounts
);
return
shallowMount
(
RelatedItemsTreeHeader
,
{
return
shallowMount
(
RelatedItemsTreeHeader
,
{
...
@@ -64,6 +68,16 @@ describe('RelatedItemsTree', () => {
...
@@ -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
'
,
()
=>
{
describe
(
'
epic issue actions split button
'
,
()
=>
{
beforeEach
(()
=>
{
beforeEach
(()
=>
{
wrapper
=
createComponent
();
wrapper
=
createComponent
();
...
@@ -235,6 +249,15 @@ describe('RelatedItemsTree', () => {
...
@@ -235,6 +249,15 @@ describe('RelatedItemsTree', () => {
expect
(
issueIcon
.
isVisible
()).
toBe
(
true
);
expect
(
issueIcon
.
isVisible
()).
toBe
(
true
);
expect
(
issueIcon
.
props
(
'
name
'
)).
toBe
(
'
issues
'
);
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