Commit acc25ab8 authored by Michael Le's avatar Michael Le Committed by Kushal Pandya

Use closed icons for issue and epics

parent 3f68c499
...@@ -80,7 +80,10 @@ export default { ...@@ -80,7 +80,10 @@ export default {
return this.isOpen ? __('Opened') : __('Closed'); return this.isOpen ? __('Opened') : __('Closed');
}, },
stateIconName() { stateIconName() {
return this.item.type === ChildType.Epic ? 'epic' : 'issues'; if (this.item.type === ChildType.Epic) {
return this.isOpen ? 'epic' : 'epic-closed';
}
return this.isOpen ? 'issues' : 'issue-closed';
}, },
stateIconClass() { stateIconClass() {
return this.isOpen return this.isOpen
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
} }
&.item-closed { &.item-closed {
background-color: $gray-10; background-color: $white;
} }
} }
......
---
title: Use closed icons for issues and epics when closed
merge_request: 47176
author:
type: changed
...@@ -242,10 +242,10 @@ describe('RelatedItemsTree', () => { ...@@ -242,10 +242,10 @@ describe('RelatedItemsTree', () => {
}); });
describe.each` describe.each`
createItem | itemType | isEpic | stateIconName createItem | itemType | isEpic
${createEpicItem} | ${'epic'} | ${true} | ${'epic'} ${createEpicItem} | ${'epic'} | ${true}
${createIssueItem} | ${'issue'} | ${false} | ${'issues'} ${createIssueItem} | ${'issue'} | ${false}
`(`when dependent on item type`, ({ createItem, isEpic, stateIconName, itemType }) => { `(`when dependent on item type`, ({ createItem, isEpic, itemType }) => {
beforeEach(() => { beforeEach(() => {
mockItem = createItem(); mockItem = createItem();
wrapper = createComponent(); wrapper = createComponent();
...@@ -256,9 +256,25 @@ describe('RelatedItemsTree', () => { ...@@ -256,9 +256,25 @@ describe('RelatedItemsTree', () => {
expect(wrapper.vm.isEpic).toBe(isEpic); expect(wrapper.vm.isEpic).toBe(isEpic);
}); });
}); });
});
describe.each`
createItem | testDesc | stateIconName
${createEpicItem(mockOpenEpic)} | ${'epic is `open`'} | ${'epic'}
${createEpicItem(mockClosedEpic)} | ${'epic is `closed`'} | ${'epic-closed'}
${createIssueItem(mockIssue1)} | ${'issue is `open`'} | ${'issues'}
${createIssueItem(mockClosedIssue)} | ${'issue is `closed`'} | ${'issue-closed'}
`(`when dependent on item type and state`, ({ createItem, testDesc, stateIconName }) => {
beforeEach(() => {
mockItem = createItem;
});
describe('stateIconName', () => { describe('stateIconName', () => {
it(`returns string ${stateIconName}`, async () => { it(`returns string \`${stateIconName}\` when ${testDesc}`, async () => {
wrapper.setProps({
item: mockItem,
});
await wrapper.vm.$nextTick(); await wrapper.vm.$nextTick();
expect(wrapper.vm.stateIconName).toBe(stateIconName); expect(wrapper.vm.stateIconName).toBe(stateIconName);
......
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