mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
correct tests
This commit is contained in:
parent
1a694c04e4
commit
a591c019d4
2 changed files with 5 additions and 3 deletions
|
@ -61,7 +61,9 @@ export function categoryBadgeHTML(category, opts) {
|
||||||
href = " href='" + href + "' ";
|
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) {
|
export function categoryLinkHTML(category, options) {
|
||||||
|
|
|
@ -16,8 +16,8 @@ test("Regular categoryBadge", function() {
|
||||||
}),
|
}),
|
||||||
tag = parseHTML(categoryBadgeHTML(category))[0];
|
tag = parseHTML(categoryBadgeHTML(category))[0];
|
||||||
|
|
||||||
equal(tag.name, 'span', 'it creates a `span` wrapper tag');
|
equal(tag.name, 'a', 'it creates a `a` wrapper tag');
|
||||||
equal(tag.attributes['class'], 'badge-wrapper', 'it has the correct class');
|
equal(tag.attributes['class'].trim(), 'badge-wrapper', 'it has the correct class');
|
||||||
|
|
||||||
var label = tag.children[1];
|
var label = tag.children[1];
|
||||||
equal(label.attributes.title, 'cool description', 'it has the correct title');
|
equal(label.attributes.title, 'cool description', 'it has the correct title');
|
||||||
|
|
Loading…
Reference in a new issue