UX: Prevent category-drop topic count from wrapping to new line (#8943)

This commit is contained in:
Penar Musaraj
2020-02-12 14:34:16 -05:00
committed by GitHub
parent c36ae17260
commit efa9ba4975
4 changed files with 24 additions and 4 deletions

View File

@ -46,6 +46,21 @@ QUnit.test("undefined color", assert => {
);
});
QUnit.test("topic count", assert => {
const store = createStore();
const category = store.createRecord("category", { name: "hello", id: 123 });
assert.equal(
categoryBadgeHTML(category).indexOf("topic-count"),
-1,
"it does not include topic count by default"
);
assert.ok(
categoryBadgeHTML(category, { topicCount: 20 }).indexOf("topic-count") > 20,
"is included when specified"
);
});
QUnit.test("allowUncategorized", assert => {
const store = createStore();
const uncategorized = store.createRecord("category", {