Skip to content

Commit 7d9f29f

Browse files
committed
fix: Wait for the app to settle after login and logout.
1 parent 2dd3a90 commit 7d9f29f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tests/helpers/custom-helpers.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { click, fillIn, currentURL, visit } from '@ember/test-helpers';
1+
import { click, fillIn, currentURL, visit, settled } from '@ember/test-helpers';
22
import { currentSession } from 'ember-simple-auth/test-support';
33

44
export async function login(assert, email = null, password = null, gotoLoginPage = true) {
@@ -9,10 +9,12 @@ export async function login(assert, email = null, password = null, gotoLoginPage
99
await fillIn('input[name=email]', email !== null ? email : '[email protected]');
1010
await fillIn('input[name=password]', password !== null ? password : 'test-fe-user');
1111
await click('button[type=submit]');
12+
await settled();
1213
}
1314

1415
export async function logout(assert) {
1516
await visit('/logout');
17+
await settled();
1618
assert.equal(currentURL(), '/');
1719
assert.ok(currentSession().session.isAuthenticated !== true);
1820
}

0 commit comments

Comments
 (0)