Skip to content

Commit 01c8bcc

Browse files
authored
fix(e2e): Fix issue counting requests (#6554)
1 parent 17def2b commit 01c8bcc

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changeset/shaky-cities-search.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

integration/tests/next-quickstart-keyless.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ test.describe('Keyless mode @quickstart', () => {
4141
await app.teardown();
4242
});
4343

44-
test('Navigates to non existed page (/_not-found) without a infinite redirect loop.', async ({ page, context }) => {
44+
test('Navigates to non-existent page (/_not-found) without a infinite redirect loop.', async ({ page, context }) => {
4545
const u = createTestUtils({ app, page, context });
4646
await u.page.goToAppHome();
4747
await u.page.waitForClerkJsLoaded();
@@ -51,9 +51,12 @@ test.describe('Keyless mode @quickstart', () => {
5151

5252
const redirectMap = new Map<string, number>();
5353
page.on('request', request => {
54-
const url = request.url();
55-
redirectMap.set(url, (redirectMap.get(url) || 0) + 1);
56-
expect(redirectMap.get(url)).toBeLessThanOrEqual(1);
54+
// Only count GET requests since Next.js server actions are sent with POST requests.
55+
if (request.method() === 'GET') {
56+
const url = request.url();
57+
redirectMap.set(url, (redirectMap.get(url) || 0) + 1);
58+
expect(redirectMap.get(url)).toBeLessThanOrEqual(1);
59+
}
5760
});
5861

5962
await u.page.goToRelative('/something');

0 commit comments

Comments
 (0)