Commit 41e3a8a2 authored by Tim Zallmann's avatar Tim Zallmann Committed by Jarka Kadlecova

Merge branch 'issue-boards-closed-shows-empty-label' into 'master'

Fixed issue boards closed list displaying empty label

Closes #36650

See merge request !13658
parent 5d5f7504
......@@ -97,7 +97,7 @@ gl.issueBoards.IssueCardInner = Vue.extend({
return `Avatar for ${assignee.name}`;
},
showLabel(label) {
if (!this.list || !label) return true;
if (!label.id) return false;
return true;
},
filterByLabel(label, e) {
......
......@@ -278,6 +278,25 @@ describe('Issue card component', () => {
nodes.includes(label1.color),
).toBe(true);
});
it('does not render label if label does not have an ID', (done) => {
component.issue.addLabel(new ListLabel({
title: 'closed',
}));
Vue.nextTick()
.then(() => {
expect(
component.$el.querySelectorAll('.label').length,
).toBe(2);
expect(
component.$el.textContent,
).not.toContain('closed');
done();
})
.catch(done.fail);
});
});
});
});
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