Skip to content

Commit

Permalink
test(repo): Update navigation integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
octoper committed Nov 22, 2023
1 parent 30edd68 commit c4c1367
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions integration/tests/navigation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,19 @@ export default function Page() {

await u.page.getByRole('button', { name: /Set username/i }).click();

await u.page.waitForURL('**/user/username');
await u.page.waitForURL(`${app.serverUrl}/user/username`);

await u.page.getByRole('button', { name: /Cancel/i }).click();

await u.page.waitForURL(`${app.serverUrl}/user`);

await u.page.getByRole('button', { name: /Add an email address/i }).click();

await u.page.waitForURL(`${app.serverUrl}/user/email-address`);

await u.page.getByRole('button', { name: /Cancel/i }).click();

await u.page.waitForURL(`${app.serverUrl}/user`);
});

test('user profile with hash router', async ({ page, context }) => {
Expand All @@ -106,6 +118,18 @@ export default function Page() {

await u.page.getByRole('button', { name: /Set username/i }).click();

expect(u.page.url()).toContain('user#/username');
expect(u.page.url()).toBe(`${app.serverUrl}/hash/user#/username`);

await u.page.getByRole('button', { name: /Cancel/i }).click();

expect(u.page.url()).toBe(`${app.serverUrl}/hash/user#`);

await u.page.getByRole('button', { name: /Add an email address/i }).click();

expect(u.page.url()).toBe(`${app.serverUrl}/hash/user#/email-address`);

await u.page.getByRole('button', { name: /Cancel/i }).click();

expect(u.page.url()).toBe(`${app.serverUrl}/hash/user#`);
});
});

0 comments on commit c4c1367

Please sign in to comment.