fix labels showing up with no title

This commit is contained in:
Jose 2018-06-04 16:39:44 -05:00
parent 3571b97eff
commit 11a9389c4f
No known key found for this signature in database
GPG Key ID: 01F49A6AE27697FB
2 changed files with 5 additions and 1 deletions

View File

@ -426,7 +426,7 @@ export default class LabelsSelect {
const tpl = _.template([
'<% _.each(labels, function(label){ %>',
'<a href="<%- issueUpdateURL.slice(0, issueUpdateURL.lastIndexOf("/")) %>?label_name[]=<%- encodeURIComponent(label.title) %>">',
'<span class="label has-tooltip color-label" title="<%- label.description %>" style="background-color: <%- label.color %>; color: <%- label.text_color %>;">',
'<span class="badge label has-tooltip color-label" title="<%- label.description %>" style="background-color: <%- label.color %>; color: <%- label.text_color %>;">',
'<%- label.title %>',
'</span>',
'</a>',

View File

@ -40,5 +40,9 @@ describe('LabelsSelect', () => {
it('generated label item template has correct label styles', () => {
expect($labelEl.find('span.label').attr('style')).toBe(`background-color: ${label.color}; color: ${label.text_color};`);
});
it('generated label item has a badge class', () => {
expect($labelEl.find('span').hasClass('badge')).toEqual(true);
});
});
});