correct tests
This commit is contained in:
parent
1a694c04e4
commit
a591c019d4
|
@ -61,7 +61,9 @@ export function categoryBadgeHTML(category, opts) {
|
|||
href = " href='" + href + "' ";
|
||||
}
|
||||
|
||||
return "<" + tagName + " class='badge-wrapper " + Discourse.SiteSettings.category_style + extraClasses + "' " + href + ">" + html + "</" + tagName + ">";
|
||||
extraClasses = Discourse.SiteSettings.category_style ? Discourse.SiteSettings.category_style + extraClasses : extraClasses;
|
||||
|
||||
return "<" + tagName + " class='badge-wrapper " + extraClasses + "' " + href + ">" + html + "</" + tagName + ">";
|
||||
}
|
||||
|
||||
export function categoryLinkHTML(category, options) {
|
||||
|
|
|
@ -16,8 +16,8 @@ test("Regular categoryBadge", function() {
|
|||
}),
|
||||
tag = parseHTML(categoryBadgeHTML(category))[0];
|
||||
|
||||
equal(tag.name, 'span', 'it creates a `span` wrapper tag');
|
||||
equal(tag.attributes['class'], 'badge-wrapper', 'it has the correct class');
|
||||
equal(tag.name, 'a', 'it creates a `a` wrapper tag');
|
||||
equal(tag.attributes['class'].trim(), 'badge-wrapper', 'it has the correct class');
|
||||
|
||||
var label = tag.children[1];
|
||||
equal(label.attributes.title, 'cool description', 'it has the correct title');
|
||||
|
|
Loading…
Reference in New Issue