Fixed issue boards closed list displaying empty label

Closes #36650
This commit is contained in:
Phil Hughes 2017-08-18 10:57:02 +01:00
parent 6ed01ebf91
commit ad46dcca40
No known key found for this signature in database
GPG Key ID: DB8CE4B3A3EE91AB
2 changed files with 20 additions and 1 deletions

View File

@ -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) {

View File

@ -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);
});
});
});
});