Skip to content

Commit

Permalink
Merge pull request #19384 from bertdeblock/use-qunit-dom-in-helper-an…
Browse files Browse the repository at this point in the history
…d-component-test-blueprints

Use qunit-dom in helper and component test blueprints
  • Loading branch information
rwjblue committed Feb 24, 2021
2 parents 81a1c79 + bc2a38c commit 28c18d0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Expand Up @@ -12,7 +12,7 @@ module('<%= friendlyTestDescription %>', function(hooks) {

await render(hbs`<%= selfCloseComponent(componentName) %>`);

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

// Template block usage:
await render(hbs`
Expand All @@ -21,7 +21,7 @@ module('<%= friendlyTestDescription %>', function(hooks) {
<%= closeComponent(componentName) %>
`);

assert.equal(this.element.textContent.trim(), 'template block text');
assert.dom(this.element).hasText('template block text');
});
});<% } else if (testType === 'unit') { %>import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';
Expand Down
Expand Up @@ -12,7 +12,7 @@ module('<%= friendlyTestName %>', function(hooks) {

await render(hbs`{{<%= dasherizedModuleName %> inputValue}}`);

assert.equal(this.element.textContent.trim(), '1234');
assert.dom(this.element).hasText('1234');
});
});<% } else if (testType === 'unit') { %>import { <%= camelizedModuleName %> } from '<%= dasherizedModulePrefix %>/helpers/<%= dasherizedModuleName %>';
import { module, test } from 'qunit';
Expand Down
4 changes: 2 additions & 2 deletions node-tests/fixtures/component-test/rfc232.js
Expand Up @@ -12,7 +12,7 @@ module('Integration | Component | x-foo', function(hooks) {

await render(hbs`<XFoo />`);

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

// Template block usage:
await render(hbs`
Expand All @@ -21,6 +21,6 @@ module('Integration | Component | x-foo', function(hooks) {
</XFoo>
`);

assert.equal(this.element.textContent.trim(), 'template block text');
assert.dom(this.element).hasText('template block text');
});
});
2 changes: 1 addition & 1 deletion node-tests/fixtures/helper-test/rfc232.js
Expand Up @@ -12,6 +12,6 @@ module('Integration | Helper | foo/bar-baz', function(hooks) {

await render(hbs`{{foo/bar-baz inputValue}}`);

assert.equal(this.element.textContent.trim(), '1234');
assert.dom(this.element).hasText('1234');
});
});

0 comments on commit 28c18d0

Please sign in to comment.