Commit 4da6366d authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '214421-epic-and-issue-path-reference-is-undefined-in-epic-tree-view' into 'master'

Fix undefined epic issue path in epic tree

See merge request gitlab-org/gitlab!29557
parents 2ac4e4c3 3428650c
...@@ -88,6 +88,9 @@ export default { ...@@ -88,6 +88,9 @@ export default {
itemId() { itemId() {
return this.itemReference.split(this.item.pathIdSeparator).pop(); return this.itemReference.split(this.item.pathIdSeparator).pop();
}, },
itemPath() {
return this.itemReference.split(this.item.pathIdSeparator)[0];
},
itemHierarchy() { itemHierarchy() {
return this.itemPath + this.item.pathIdSeparator + this.itemId; return this.itemPath + this.item.pathIdSeparator + this.itemId;
}, },
......
...@@ -237,6 +237,12 @@ describe('RelatedItemsTree', () => { ...@@ -237,6 +237,12 @@ describe('RelatedItemsTree', () => {
}); });
}); });
describe('itemPath', () => {
it('returns string containing item path', () => {
expect(wrapper.vm.itemPath).toBe('gitlab-org/gitlab-shell');
});
});
describe('computedPath', () => { describe('computedPath', () => {
it('returns value of `itemWebPath` when it is defined', () => { it('returns value of `itemWebPath` when it is defined', () => {
expect(wrapper.vm.computedPath).toBe(mockItem.webPath); expect(wrapper.vm.computedPath).toBe(mockItem.webPath);
...@@ -313,6 +319,7 @@ describe('RelatedItemsTree', () => { ...@@ -313,6 +319,7 @@ describe('RelatedItemsTree', () => {
const path = itemPath + mockItem.pathIdSeparator + itemId; const path = itemPath + mockItem.pathIdSeparator + itemId;
expect(stateTooltip.props('path')).toBe(path); expect(stateTooltip.props('path')).toBe(path);
expect(path).toContain('gitlab-org/gitlab-shell');
}); });
it('renders confidential icon when `item.confidential` is true', () => { it('renders confidential icon when `item.confidential` is true', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment