FIX: topic title in search contains data-topic-id (#9435)

Data topic id is required by the discourse-encrypt plugin.

Related to https://github.com/discourse/discourse-encrypt/pull/12
This commit is contained in:
Krzysztof Kotlarek 2020-04-17 09:35:26 +10:00 committed by GitHub
parent e8e764c064
commit 5a60a4233e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -145,7 +145,11 @@ createSearchResult({
const firstLine = [
this.attach("topic-status", { topic, disableActions: true }),
h("span.topic-title", new Highlighted(topic.fancyTitle, term))
h(
"span.topic-title",
{ attributes: { "data-topic-id": topic.id } },
new Highlighted(topic.fancyTitle, term)
)
];
const secondLine = [

View File

@ -28,6 +28,10 @@ QUnit.test("search", async assert => {
await fillIn("#search-term", "dev");
await keyEvent("#search-term", "keyup", 16);
assert.ok(exists(".search-menu .results ul li"), "it shows results");
assert.ok(
exists(".search-menu .results ul li .topic-title[data-topic-id]"),
"topic has data-topic-id"
);
await click(".show-help");