2016-11-23 03:02:47 +08:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
|
|
|
|
const CONNECTOR = 'javascripts/single-test/connectors/user-profile-primary/hello';
|
|
|
|
acceptance("Plugin Outlet - Single Template", {
|
|
|
|
setup() {
|
|
|
|
Ember.TEMPLATES[CONNECTOR] = Ember.HTMLBars.compile(
|
2016-12-20 00:19:10 +08:00
|
|
|
`<span class='hello-username'>{{model.username}}</span>`
|
2016-11-23 03:02:47 +08:00
|
|
|
);
|
|
|
|
},
|
|
|
|
|
|
|
|
teardown() {
|
|
|
|
delete Ember.TEMPLATES[CONNECTOR];
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
test("Renders a template into the outlet", assert => {
|
2017-03-29 02:27:54 +08:00
|
|
|
visit("/u/eviltrout");
|
2016-11-23 03:02:47 +08:00
|
|
|
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');
|
|
|
|
});
|
|
|
|
});
|