Add followup test for displaying post in query results (#198)

This commit is contained in:
Isaac Janzen 2022-12-14 12:09:25 -06:00 committed by GitHub
parent 2934cc2129
commit 479d51faf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 39 additions and 0 deletions

View File

@ -100,6 +100,45 @@ discourseModule(
);
},
});
componentTest("it renders a post in query results", {
template: hbs`{{query-result content=content}}`,
beforeEach() {
const results = {
colrender: { 0: "post" },
relations: {
post: [
{
description: "description",
id: 1,
topic_id: 1,
post_number: 1,
excerpt: "foo",
username: "user1",
avatar_template: "",
},
],
},
result_count: 1,
columns: [""],
rows: [[1]],
};
this.set("content", results);
},
test(assert) {
assert.ok(
query("table tbody tr:nth-child(1) td:nth-child(1) aside").dataset
.post === "1"
);
assert.ok(
query("table tbody tr:nth-child(1) td:nth-child(1) aside").dataset
.topic === "1"
);
},
});
}
);