Skip to content
This repository has been archived by the owner on Jan 18, 2021. It is now read-only.

Commit

Permalink
Merge pull request #149 from rondale-sc/update-component-test-blueprint
Browse files Browse the repository at this point in the history
Update component-test blueprint to use render import and testContext data passing
  • Loading branch information
rwjblue committed Oct 22, 2018
2 parents d4c970e + 3beb74b commit c48dcaa
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { setupRenderingTest } from '@glimmer/test-helpers';
import { setupRenderingTest, render } from '@glimmer/test-helpers';
import hbs from '@glimmer/inline-precompile';

const { module, test } = QUnit;
Expand All @@ -7,7 +7,26 @@ module('Component: <%= componentName %>', function(hooks) {
setupRenderingTest(hooks);

test('it renders', async function(assert) {
await this.render(hbs`<<%= componentName %> />`);
/*
* You may pass data into the component through arguments set on the
* `testContext`
*
* For example:
*
* ```
* this.foo = { foo: '123' };
*
* await render(hbs`<<%= componentName %> @foo={{this.foo}} />`)
*
* // or
*
* this.foo = 'bar';
* await render(hbs`<p>{{this.foo}}</p>`);
*
* assert.dom('p').text('bar');
* ```
*/
await render(hbs`<<%= componentName %> />`);
assert.ok(this.containerElement.querySelector('div'));
});
});

0 comments on commit c48dcaa

Please sign in to comment.