Skip to content

Commit

Permalink
test navigating within an app
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Jun 19, 2023
1 parent 8f92d65 commit 06452c6
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,15 @@ describe('ApplicationService', () => {
await flushPromises();
await navigate('/app/app2#/foo');
await flushPromises();
await navigate('/app/app2#/another-path');
await flushPromises();

expect(locations).toEqual(['/', '/app/app1/bar', '/app/app2#/foo']);
expect(locations).toEqual([
'/',
'/app/app1/bar',
'/app/app2#/foo',
'/app/app2#/another-path',
]);
});
});

Expand Down Expand Up @@ -194,8 +201,12 @@ describe('ApplicationService', () => {
await navigateToApp('app2', { path: '/nested' });
update();
});
await act(async () => {
await navigateToApp('app2', { path: '/another-path' });
update();
});

expect(locations).toEqual(['/', '/app/app1', '/app/app2/nested']);
expect(locations).toEqual(['/', '/app/app1', '/app/app2/nested', '/app/app2/another-path']);
});

it('replaces the current history entry when the `replace` option is true', async () => {
Expand Down

0 comments on commit 06452c6

Please sign in to comment.