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
7a7f95f0
Commit
7a7f95f0
authored
Aug 25, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix displaying weight of 0 for issues in epic tree
Changelog: fixed EE: true
parent
f79559cd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
13 deletions
+31
-13
ee/app/assets/javascripts/related_items_tree/components/tree_item_body.vue
...ascripts/related_items_tree/components/tree_item_body.vue
+5
-2
ee/spec/frontend/related_items_tree/components/tree_item_body_spec.js
...tend/related_items_tree/components/tree_item_body_spec.js
+26
-11
No files found.
ee/app/assets/javascripts/related_items_tree/components/tree_item_body.vue
View file @
7a7f95f0
...
@@ -7,7 +7,7 @@ import {
...
@@ -7,7 +7,7 @@ import {
GlButton
,
GlButton
,
GlTooltip
,
GlTooltip
,
}
from
'
@gitlab/ui
'
;
}
from
'
@gitlab/ui
'
;
import
{
isEmpty
}
from
'
lodash
'
;
import
{
isEmpty
,
isNumber
}
from
'
lodash
'
;
import
{
mapState
,
mapActions
}
from
'
vuex
'
;
import
{
mapState
,
mapActions
}
from
'
vuex
'
;
import
ItemWeight
from
'
ee/boards/components/issue_card_weight.vue
'
;
import
ItemWeight
from
'
ee/boards/components/issue_card_weight.vue
'
;
...
@@ -75,6 +75,9 @@ export default {
...
@@ -75,6 +75,9 @@ export default {
hasAssignees
()
{
hasAssignees
()
{
return
this
.
item
.
assignees
&&
this
.
item
.
assignees
.
length
>
0
;
return
this
.
item
.
assignees
&&
this
.
item
.
assignees
.
length
>
0
;
},
},
hasWeight
()
{
return
isNumber
(
this
.
item
.
weight
);
},
stateText
()
{
stateText
()
{
return
this
.
isOpen
?
__
(
'
Opened
'
)
:
__
(
'
Closed
'
);
return
this
.
isOpen
?
__
(
'
Opened
'
)
:
__
(
'
Closed
'
);
},
},
...
@@ -260,7 +263,7 @@ export default {
...
@@ -260,7 +263,7 @@ export default {
/>
/>
<
item
-
weight
<
item
-
weight
v
-
if
=
"
item.w
eight
"
v
-
if
=
"
hasW
eight
"
:
weight
=
"
item.weight
"
:
weight
=
"
item.weight
"
class
=
"
item-weight gl-display-flex gl-align-items-center gl-mr-5!
"
class
=
"
item-weight gl-display-flex gl-align-items-center gl-mr-5!
"
tag
-
name
=
"
span
"
tag
-
name
=
"
span
"
...
...
ee/spec/frontend/related_items_tree/components/tree_item_body_spec.js
View file @
7a7f95f0
import
{
GlButton
,
GlLink
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlLink
,
GlIcon
}
from
'
@gitlab/ui
'
;
import
{
shallowMount
,
createLocalVue
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
Vue
from
'
vue
'
;
import
Vuex
from
'
vuex
'
;
import
Vuex
from
'
vuex
'
;
import
ItemWeight
from
'
ee/boards/components/issue_card_weight.vue
'
;
import
ItemWeight
from
'
ee/boards/components/issue_card_weight.vue
'
;
...
@@ -28,8 +29,7 @@ import {
...
@@ -28,8 +29,7 @@ import {
mockEpicMeta3
,
mockEpicMeta3
,
}
from
'
../mock_data
'
;
}
from
'
../mock_data
'
;
const
localVue
=
createLocalVue
();
Vue
.
use
(
Vuex
);
localVue
.
use
(
Vuex
);
let
mockItem
;
let
mockItem
;
...
@@ -68,7 +68,6 @@ const createComponent = (parentItem = mockParentItem, item = mockItem) => {
...
@@ -68,7 +68,6 @@ const createComponent = (parentItem = mockParentItem, item = mockItem) => {
});
});
return
shallowMount
(
TreeItemBody
,
{
return
shallowMount
(
TreeItemBody
,
{
localVue
,
store
,
store
,
propsData
:
{
propsData
:
{
parentItem
,
parentItem
,
...
@@ -337,7 +336,7 @@ describe('RelatedItemsTree', () => {
...
@@ -337,7 +336,7 @@ describe('RelatedItemsTree', () => {
});
});
it
(
'
renders item link
'
,
()
=>
{
it
(
'
renders item link
'
,
()
=>
{
const
link
=
wrapper
.
find
(
GlLink
);
const
link
=
wrapper
.
find
Component
(
GlLink
);
expect
(
link
.
attributes
(
'
href
'
)).
toBe
(
mockItem
.
webPath
);
expect
(
link
.
attributes
(
'
href
'
)).
toBe
(
mockItem
.
webPath
);
expect
(
link
.
text
()).
toBe
(
mockItem
.
title
);
expect
(
link
.
text
()).
toBe
(
mockItem
.
title
);
...
@@ -350,13 +349,13 @@ describe('RelatedItemsTree', () => {
...
@@ -350,13 +349,13 @@ describe('RelatedItemsTree', () => {
});
});
it
(
'
renders item milestone when it has milestone
'
,
()
=>
{
it
(
'
renders item milestone when it has milestone
'
,
()
=>
{
const
milestone
=
wrapper
.
find
(
ItemMilestone
);
const
milestone
=
wrapper
.
find
Component
(
ItemMilestone
);
expect
(
milestone
.
isVisible
()).
toBe
(
true
);
expect
(
milestone
.
isVisible
()).
toBe
(
true
);
});
});
it
(
'
renders item due date when it has due date
'
,
()
=>
{
it
(
'
renders item due date when it has due date
'
,
()
=>
{
const
dueDate
=
wrapper
.
find
(
ItemDueDate
);
const
dueDate
=
wrapper
.
find
Component
(
ItemDueDate
);
expect
(
dueDate
.
isVisible
()).
toBe
(
true
);
expect
(
dueDate
.
isVisible
()).
toBe
(
true
);
});
});
...
@@ -371,23 +370,39 @@ describe('RelatedItemsTree', () => {
...
@@ -371,23 +370,39 @@ describe('RelatedItemsTree', () => {
await
wrapper
.
vm
.
$nextTick
();
await
wrapper
.
vm
.
$nextTick
();
expect
(
wrapper
.
find
(
ItemDueDate
).
props
(
'
closed
'
)).
toBe
(
true
);
expect
(
wrapper
.
find
Component
(
ItemDueDate
).
props
(
'
closed
'
)).
toBe
(
true
);
});
});
it
(
'
renders item weight when it has weight
'
,
()
=>
{
it
(
'
renders item weight when it has weight
'
,
()
=>
{
const
weight
=
wrapper
.
find
(
ItemWeight
);
const
weight
=
wrapper
.
find
Component
(
ItemWeight
);
expect
(
weight
.
isVisible
()).
toBe
(
true
);
expect
(
weight
.
isVisible
()).
toBe
(
true
);
});
});
it
(
'
renders item weight when it has weight of 0
'
,
async
()
=>
{
wrapper
.
setProps
({
item
:
{
...
mockItem
,
weight
:
0
,
},
});
await
wrapper
.
vm
.
$nextTick
();
const
weight
=
wrapper
.
findComponent
(
ItemWeight
);
expect
(
weight
.
isVisible
()).
toBe
(
true
);
expect
(
weight
.
props
(
'
weight
'
)).
toBe
(
0
);
});
it
(
'
renders item assignees when it has assignees
'
,
()
=>
{
it
(
'
renders item assignees when it has assignees
'
,
()
=>
{
const
assignees
=
wrapper
.
find
(
ItemAssignees
);
const
assignees
=
wrapper
.
find
Component
(
ItemAssignees
);
expect
(
assignees
.
isVisible
()).
toBe
(
true
);
expect
(
assignees
.
isVisible
()).
toBe
(
true
);
});
});
it
(
'
renders item remove button when `item.userPermissions.adminEpic` is true
'
,
()
=>
{
it
(
'
renders item remove button when `item.userPermissions.adminEpic` is true
'
,
()
=>
{
const
removeButton
=
wrapper
.
find
(
GlButton
);
const
removeButton
=
wrapper
.
find
Component
(
GlButton
);
expect
(
removeButton
.
isVisible
()).
toBe
(
true
);
expect
(
removeButton
.
isVisible
()).
toBe
(
true
);
expect
(
removeButton
.
attributes
(
'
title
'
)).
toBe
(
'
Remove
'
);
expect
(
removeButton
.
attributes
(
'
title
'
)).
toBe
(
'
Remove
'
);
...
...
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