Skip to content

Commit

Permalink
fix: fixed test [WTEL-3840]
Browse files Browse the repository at this point in the history
  • Loading branch information
dlohvinov committed Nov 22, 2023
1 parent 628c8f0 commit 9337c26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modules/Userinfo/components/__tests__/auth.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,12 @@ describe('Auth', () => {
it('sets token, gets session and opens app after auth token message emit', async () => {
const accessToken = 'hello there';
window.postMessage({ accessToken }, '*');
await setTimeout(() => {
await new Promise((resolve) => setTimeout(() => {
expect(authAPI.setToken).toHaveBeenCalledWith(accessToken);
expect(userinfoAPI.getSession).toHaveBeenCalled();
expect(userinfoAPI.getApplicationsAccess).toHaveBeenCalled();
expect(router.replace).toHaveBeenCalled();
}, 100);
resolve();
}, 100));
});
});

0 comments on commit 9337c26

Please sign in to comment.