discourse/test/javascripts/acceptance/plugin-outlet-single-template-test.js.es6

22 lines
698 B
Plaintext
Raw Normal View History

import { acceptance } from "helpers/qunit-helpers";
const CONNECTOR = 'javascripts/single-test/connectors/user-profile-primary/hello';
acceptance("Plugin Outlet - Single Template", {
2017-06-15 01:57:58 +08:00
beforeEach() {
Ember.TEMPLATES[CONNECTOR] = Ember.HTMLBars.compile(
`<span class='hello-username'>{{model.username}}</span>`
);
},
2017-06-15 01:57:58 +08:00
afterEach() {
delete Ember.TEMPLATES[CONNECTOR];
}
});
2017-06-15 01:57:58 +08:00
QUnit.test("Renders a template into the outlet", assert => {
2017-03-29 02:27:54 +08:00
visit("/u/eviltrout");
andThen(() => {
assert.ok(find('.user-profile-primary-outlet.hello').length === 1, 'it has class names');
assert.equal(find('.hello-username').text(), 'eviltrout', 'it renders into the outlet');
});
2017-06-15 01:57:58 +08:00
});