diff --git a/tests/node/app-boot-test.js b/tests/node/app-boot-test.js index f1bbe0bfaec..80ec9d1a837 100644 --- a/tests/node/app-boot-test.js +++ b/tests/node/app-boot-test.js @@ -13,21 +13,21 @@ QUnit.module('App Boot', function (hooks) { QUnit.test('nested {{component}}', function (assert) { this.template('index', '{{root-component}}'); - this.template( - 'components/root-component', + this.component( + 'root-component', + { + location: 'World', + hasExistence: true, + }, "\ -

Hello {{#if this.hasExistence}}{{this.location}}{{/if}}

\ -
{{component 'foo-bar'}}
\ - " +

Hello {{#if this.hasExistence}}{{this.location}}{{/if}}

\ +
{{component 'foo-bar'}}
\ + " ); - this.component('root-component', { - location: 'World', - hasExistence: true, - }); - - this.template( - 'components/foo-bar', + this.component( + 'foo-bar', + undefined, '\

The files are *inside* the computer?!

\ ' diff --git a/tests/node/helpers/setup-app.js b/tests/node/helpers/setup-app.js index 2e6a1ec4328..0a6738c9168 100644 --- a/tests/node/helpers/setup-app.js +++ b/tests/node/helpers/setup-app.js @@ -61,6 +61,8 @@ module.exports = function (hooks) { this.Ember = Ember; this.compile = compile; + this.setComponentTemplate = Ember._setComponentTemplate; + this.templateOnlyComponent = Ember._templateOnlyComponent; Ember.testing = true; @@ -166,8 +168,11 @@ function registerTemplate(name, template) { this.register('template:' + name, this.compile(template)); } -function registerComponent(name, componentProps) { - let component = this.Ember.Component.extend(componentProps); +function registerComponent(name, componentProps, templateContents) { + let component = this.setComponentTemplate( + this.compile(templateContents), + componentProps ? this.Ember.Component.extend(componentProps) : this.templateOnlyComponent() + ); this.register('component:' + name, component); }