Add test for category result (#200)

This commit is contained in:
Isaac Janzen 2022-12-15 11:35:18 -06:00 committed by GitHub
parent 9025646dc9
commit bd602b02a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 35 additions and 0 deletions

View File

@ -139,6 +139,41 @@ discourseModule(
); );
}, },
}); });
componentTest("it renders a category_id in query results", {
template: hbs`{{query-result content=content}}`,
beforeEach() {
const results = {
colrender: { 0: "category" },
relations: {
category: [
{
id: 1,
name: "foo",
slug: "foo",
topic_count: 0,
position: 1,
description: "a category",
can_edit: true,
},
],
},
result_count: 1,
columns: [""],
rows: [[1]],
};
this.set("content", results);
},
test(assert) {
assert.ok(
exists(
"table tbody tr:nth-child(1) td:nth-child(1) span.category-name"
)
);
},
});
} }
); );