Skip to content

Commit

Permalink
Added block-template test to generated component integration test, re…
Browse files Browse the repository at this point in the history
…moved component._state from generated unit test
  • Loading branch information
trabus committed Jul 6, 2015
1 parent b6da12c commit 7b2c4ba
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions blueprints/component-test/index.js
Expand Up @@ -46,7 +46,14 @@ module.exports = {
" // Set any properties with this.set('myProperty', 'value');" + EOL +
" // Handle any actions with this.on('myAction', function(val) { ... });" + EOL + EOL +
" this.render(hbs`{{" + dasherizedModuleName + "}}`);" + EOL + EOL +
" assert.equal(this.$().text(), '')";
" assert.equal(this.$().text(), '')" + EOL + EOL +
" // Template block usage:" + EOL +
" this.render(hbs`" + EOL +
" {{#" + dasherizedModuleName + "}}" + EOL +
" template block text" + EOL +
" {{/" + dasherizedModuleName + "}}" + EOL +
" `);" + EOL + EOL +
" assert.equal(this.$().text().trim(), 'template block text');";

if (options.pod && options.path !== 'components' && options.path !== '') {
componentPathName = [options.path, dasherizedModuleName].join('/');
Expand All @@ -57,13 +64,12 @@ module.exports = {
testOptions = "// Specify the other units that are required for this test" +
EOL + " // needs: ['component:foo', 'helper:bar']," + EOL + " unit: true";

testContent = "assert.expect(2);" + EOL + EOL +
testContent = "assert.expect(1);" + EOL + EOL +
" // Creates the component instance" + EOL +
" var component = this.subject();" + EOL +
" assert.equal(component._state, 'preRender');" + EOL + EOL +
" // Renders the component to the page" + EOL +
" this.render();" + EOL +
" assert.equal(component._state, 'inDOM');";
" assert.equal(this.$().text(), '');";

friendlyTestDescription = testInfo.description(options.entity.name, "Unit", "Component");
}
Expand Down

0 comments on commit 7b2c4ba

Please sign in to comment.