Skip to content

Commit

Permalink
Fix login tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raksooo committed Sep 4, 2023
1 parent 1ee8748 commit 8e0d0df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion gui/src/renderer/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,10 @@ export default class AppRenderer {
const prevPath = this.history.location.pathname as RoutePath;
const nextPath = expired ? RoutePath.expired : RoutePath.timeAdded;
const transition = this.getNavigationTransition(prevPath, nextPath);
this.history.replaceRoot(nextPath, { transition });

if (!this.loginScheduler.isRunning) {
this.history.replaceRoot(nextPath, { transition });
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions gui/test/e2e/installed/state-dependent/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ test('App should create account', async () => {
await expect(title).toHaveText('Account created');
await expect(subtitle).toHaveText('Logged in');

expect(await util.waitForNavigation()).toEqual(RoutePath.main);
expect(await util.waitForNavigation()).toEqual(RoutePath.expired);

const outOfTimeTitle = page.getByTestId('title');
await expect(outOfTimeTitle).toHaveText('Congrats!');
Expand Down Expand Up @@ -121,7 +121,7 @@ test('App should log in to expired account', async () => {
await expect(title).toHaveText('Logged in');
await expect(subtitle).toHaveText('Valid account number');

expect(await util.waitForNavigation()).toEqual(RoutePath.main);
expect(await util.waitForNavigation()).toEqual(RoutePath.expired);

const outOfTimeTitle = page.getByTestId('title');
await expect(outOfTimeTitle).toHaveText('Out of time');
Expand Down

0 comments on commit 8e0d0df

Please sign in to comment.