mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-15 21:10:22 +01:00
test: fix tests
This commit is contained in:
@@ -113,7 +113,7 @@ module.exports = function (utils, Benchpress, relative_path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const href = tag === 'a' ? `href="${relative_path}/category/${category.slug}"` : '';
|
const href = tag === 'a' ? `href="${relative_path}/category/${category.slug}"` : '';
|
||||||
return `<${tag} ${href} component="topic/category" class="badge px-1 text-truncate text-decoration-none ${className}" style="color: ${category.color};background-color: ${category.bgColor};border-color: ${category.bgColor}!important; max-width: 70vw;">
|
return `<${tag} component="topic/category" ${href} class="badge px-1 text-truncate text-decoration-none ${className}" style="color: ${category.color};background-color: ${category.bgColor};border-color: ${category.bgColor}!important; max-width: 70vw;">
|
||||||
${category.icon && category.icon !== 'fa-nbb-none' ? `<i class="fa fa-fw ${category.icon}"></i>` : ''}
|
${category.icon && category.icon !== 'fa-nbb-none' ? `<i class="fa fa-fw ${category.icon}"></i>` : ''}
|
||||||
${category.name}
|
${category.name}
|
||||||
</${tag}>`;
|
</${tag}>`;
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ describe('helpers', () => {
|
|||||||
imageClass: 'auto',
|
imageClass: 'auto',
|
||||||
name: 'Category 1',
|
name: 'Category 1',
|
||||||
}, 'a', ''),
|
}, 'a', ''),
|
||||||
`<a href="${nconf.get('relative_path')}/category/undefined" class="badge px-1 text-truncate text-decoration-none " style="color: #00ff00;background-color: #ff0000;border-color: #ff0000!important; max-width: 70vw;">\n\t\t\t\n\t\t\tCategory 1\n\t\t</a>`
|
`<a component="topic/category" href="${nconf.get('relative_path')}/category/undefined" class="badge px-1 text-truncate text-decoration-none " style="color: #00ff00;background-color: #ff0000;border-color: #ff0000!important; max-width: 70vw;">\n\t\t\t\n\t\t\tCategory 1\n\t\t</a>`
|
||||||
);
|
);
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
helpers.buildCategoryLabel({
|
helpers.buildCategoryLabel({
|
||||||
@@ -118,7 +118,7 @@ describe('helpers', () => {
|
|||||||
name: 'Category 1',
|
name: 'Category 1',
|
||||||
icon: 'fa-book',
|
icon: 'fa-book',
|
||||||
}, 'span', 'rounded-1'),
|
}, 'span', 'rounded-1'),
|
||||||
`<span class="badge px-1 text-truncate text-decoration-none rounded-1" style="color: #00ff00;background-color: #ff0000;border-color: #ff0000!important; max-width: 70vw;">\n\t\t\t<i class="fa fa-fw fa-book"></i>\n\t\t\tCategory 1\n\t\t</span>`,
|
`<span component="topic/category" class="badge px-1 text-truncate text-decoration-none rounded-1" style="color: #00ff00;background-color: #ff0000;border-color: #ff0000!important; max-width: 70vw;">\n\t\t\t<i class="fa fa-fw fa-book"></i>\n\t\t\tCategory 1\n\t\t</span>`,
|
||||||
);
|
);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user