discourse/test/javascripts/acceptance/plugin-outlet-single-template-test.js.es6
2018-06-15 17:03:24 +02:00

31 lines
743 B
JavaScript

import { acceptance } from "helpers/qunit-helpers";
const CONNECTOR =
"javascripts/single-test/connectors/user-profile-primary/hello";
acceptance("Plugin Outlet - Single Template", {
beforeEach() {
Ember.TEMPLATES[CONNECTOR] = Ember.HTMLBars.compile(
`<span class='hello-username'>{{model.username}}</span>`
);
},
afterEach() {
delete Ember.TEMPLATES[CONNECTOR];
}
});
QUnit.test("Renders a template into the outlet", assert => {
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"
);
});
});