Skip to content

Commit

Permalink
Working component test
Browse files Browse the repository at this point in the history
  • Loading branch information
chrism committed Jun 9, 2018
1 parent 8457a7a commit 6cef5b2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
19 changes: 6 additions & 13 deletions src/ui/components/tomster-logo/component-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,13 @@ module('Integration | Component | tomster-logo', function(hooks) {
setupRenderingTest(hooks);

test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });
this.model = {
filename: "tomster",
filetype: "png"
}

await render(hbs`{{tomster-logo}}`);
await render(hbs`<TomsterLogo @filename={{model.filename}} @filetype={{model.filetype}} />`);

assert.equal(this.element.textContent.trim(), '');

// Template block usage:
await render(hbs`
{{#tomster-logo}}
template block text
{{/tomster-logo}}
`);

assert.equal(this.element.textContent.trim(), 'template block text');
assert.equal(this.element.querySelector('img').alt, 'Tomster Logo');
});
});
2 changes: 1 addition & 1 deletion src/ui/components/tomster-logo/template.hbs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<TomsterTitle @title={{@filename}} />
<img src={{this.tomsterPath}} />
<img class="tomster-logo" alt="Tomster Logo" src={{this.tomsterPath}} />

0 comments on commit 6cef5b2

Please sign in to comment.