We used many global functions to handle tests when they should be imported like other libraries in our application. This also gets us closer to the way Ember CLI prefers our tests to be laid out.
20 lines
488 B
JavaScript
20 lines
488 B
JavaScript
import { test } from "qunit";
|
|
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
|
|
|
acceptance("CustomHTML template", {
|
|
beforeEach() {
|
|
Ember.TEMPLATES["top"] = Ember.HTMLBars.compile(
|
|
`<span class='top-span'>TOP</span>`
|
|
);
|
|
},
|
|
|
|
afterEach() {
|
|
delete Ember.TEMPLATES["top"];
|
|
},
|
|
});
|
|
|
|
test("renders custom template", async (assert) => {
|
|
await visit("/static/faq");
|
|
assert.equal(find("span.top-span").text(), "TOP", "it inserted the template");
|
|
});
|