add waitUntil (#16072)

This commit is contained in:
claire bontempo 2022-06-23 11:19:27 -07:00 committed by GitHub
parent eeb4029eb1
commit c88df178c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
import { module, test } from 'qunit'; import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit'; import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers'; import { find, render, waitUntil } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile'; import hbs from 'htmlbars-inline-precompile';
import { addMinutes } from 'date-fns'; import { addMinutes } from 'date-fns';
@ -12,7 +12,7 @@ module('Integration | Component | token-expire-warning', function (hooks) {
this.set('expirationDate', expirationDate); this.set('expirationDate', expirationDate);
await render(hbs`<TokenExpireWarning @expirationDate={{expirationDate}}/>`); await render(hbs`<TokenExpireWarning @expirationDate={{expirationDate}}/>`);
await waitUntil(() => find('#modal-overlays'));
assert.dom().includesText('Your auth token expired on'); assert.dom().includesText('Your auth token expired on');
}); });
@ -25,7 +25,7 @@ module('Integration | Component | token-expire-warning', function (hooks) {
<p>Do not worry, your token has not expired.</p> <p>Do not worry, your token has not expired.</p>
</TokenExpireWarning> </TokenExpireWarning>
`); `);
await waitUntil(() => find('#modal-overlays'));
assert.dom().doesNotIncludeText('Your auth token expired on'); assert.dom().doesNotIncludeText('Your auth token expired on');
assert.dom().includesText('Do not worry'); assert.dom().includesText('Do not worry');
}); });