Skip to content

Commit 8fed57e

Browse files
committed
wait so that sign-in is triggered
1 parent b1066fd commit 8fed57e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/atlas-service/src/store/atlas-signin-reducer.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ describe('atlasSignInReducer', function () {
158158
expect(store.getState()).to.have.nested.property('state', 'initial');
159159
});
160160

161-
it('should cancel sign in if sign in is in progress', function () {
161+
it('should cancel sign in if sign in is in progress', async function () {
162162
const mockAtlasService = {
163163
isAuthenticated: sandbox
164164
.stub()
@@ -177,6 +177,9 @@ describe('atlasSignInReducer', function () {
177177

178178
void store.dispatch(performSignInAttempt()).catch(() => {});
179179

180+
// Give it some time for start the sign in attempt. It will be waiting
181+
// at isAuthenticated, which never resolves.
182+
await new Promise((resolve) => setTimeout(resolve, 100));
180183
store.dispatch(cancelSignIn());
181184
expect(store.getState()).to.have.nested.property('state', 'canceled');
182185
});

0 commit comments

Comments
 (0)