discourse/test/javascripts/acceptance/custom-html-template-test.j...

25 lines
483 B
Plaintext
Raw Normal View History

2016-11-23 12:57:50 -05:00
import { acceptance } from "helpers/qunit-helpers";
acceptance("CustomHTML template", {
2017-06-14 13:57:58 -04:00
beforeEach() {
2018-06-15 11:03:24 -04:00
Ember.TEMPLATES["top"] = Ember.HTMLBars.compile(
`<span class='top-span'>TOP</span>`
);
2016-11-23 12:57:50 -05:00
},
2017-06-14 13:57:58 -04:00
afterEach() {
2018-06-15 11:03:24 -04:00
delete Ember.TEMPLATES["top"];
2016-11-23 12:57:50 -05:00
}
});
2017-06-14 13:57:58 -04:00
QUnit.test("renders custom template", assert => {
2016-11-23 12:57:50 -05:00
visit("/static/faq");
andThen(() => {
2018-06-15 11:03:24 -04:00
assert.equal(
find("span.top-span").text(),
"TOP",
"it inserted the template"
);
2016-11-23 12:57:50 -05:00
});
});