Files
discourse/app/assets/javascripts/discourse/tests/acceptance/custom-html-template-test.js
2024-11-30 16:44:51 +01:00

26 lines
864 B
JavaScript

import { visit } from "@ember/test-helpers";
import { hbs } from "ember-cli-htmlbars";
import { test } from "qunit";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import { registerTemporaryModule } from "discourse/tests/helpers/temporary-module-helper";
import { withSilencedDeprecationsAsync } from "discourse-common/lib/deprecated";
acceptance("CustomHTML template", function (needs) {
needs.hooks.beforeEach(() => {
registerTemporaryModule(
"discourse/templates/top",
hbs`<span class='top-span'>TOP</span>`
);
});
test("renders custom template", async function (assert) {
await withSilencedDeprecationsAsync(
"discourse.custom_html_template",
async () => {
await visit("/static/faq");
assert.dom("span.top-span").hasText("TOP", "inserted the template");
}
);
});
});