import { acceptance, queryAll } from "discourse/tests/helpers/qunit-helpers"; import hbs from "htmlbars-inline-precompile"; import { test } from "qunit"; import { visit } from "@ember/test-helpers"; acceptance("CustomHTML template", function (needs) { needs.hooks.beforeEach(() => { Ember.TEMPLATES["top"] = hbs`TOP`; }); needs.hooks.afterEach(() => { delete Ember.TEMPLATES["top"]; }); test("renders custom template", async function (assert) { await visit("/static/faq"); assert.strictEqual( queryAll("span.top-span").text(), "TOP", "it inserted the template" ); }); });