This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/tests/acceptance/custom-html-template-test.js
David Taylor 9f022112e3
DEV: Support theme/plugin overrides of colocated component templates (#19237)
To theme/plugin developers, the process is the same as for overriding non-colocated component templates. Once merged, this should allow us to seamlessly convert all of core's component templates to be colocated.
2022-11-30 14:14:38 +00:00

24 lines
710 B
JavaScript

import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
import { hbs } from "ember-cli-htmlbars";
import { test } from "qunit";
import { visit } from "@ember/test-helpers";
import { registerTemporaryModule } from "discourse/tests/helpers/temporary-module-helper";
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 visit("/static/faq");
assert.strictEqual(
query("span.top-span").innerText,
"TOP",
"it inserted the template"
);
});
});