Skip to content

Commit b367bce

Browse files
author
Robert Jackson
committed
Add tests for using wait in actual test files.
1 parent 8ee80a4 commit b367bce

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

__testfixtures__/ember-qunit-codemod/module-for-component.input.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { moduleForComponent, test } from 'ember-qunit';
2+
import wait from 'ember-test-helpers/wait';
23
import hbs from 'htmlbars-inline-precompile';
34

45
moduleForComponent('foo-bar', 'Integration | Component | FooBar', {
@@ -68,5 +69,7 @@ moduleForComponent('foo-bar', 'Integration | Component | FooBar', {
6869
});
6970

7071
test('can use render in custom method', function (assert) {
71-
assert.equal(this._element.textContent, 'derp');
72+
return wait().then(() => {
73+
assert.equal(this._element.textContent, 'derp');
74+
});
7275
});

__testfixtures__/ember-qunit-codemod/module-for-component.output.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { module, test } from 'qunit';
22
import { setupRenderingTest, setupTest } from 'ember-qunit';
3-
import { clearRender, render } from 'ember-test-helpers';
3+
import { clearRender, render, settled } from 'ember-test-helpers';
44
import hbs from 'htmlbars-inline-precompile';
55

66
module('Integration | Component | FooBar', function(hooks) {
@@ -71,6 +71,8 @@ module('Integration | Component | FooBar', function(hooks) {
7171
});
7272

7373
test('can use render in custom method', function (assert) {
74-
assert.equal(this.element.textContent, 'derp');
74+
return settled().then(() => {
75+
assert.equal(this.element.textContent, 'derp');
76+
});
7577
});
7678
});

0 commit comments

Comments
 (0)