Commit 3428650c authored by Florie Guibert's avatar Florie Guibert

Fix undefined epic issue path in epic tree

parent b67aa714
...@@ -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