Skip to content

Commit

Permalink
replace incorrect expect calls with await in middleware e2es
Browse files Browse the repository at this point in the history
  • Loading branch information
dario-piotrowicz committed Jan 20, 2025
1 parent e6078b5 commit fa1d9b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/middleware/e2e/base.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ import { test, expect } from "@playwright/test";
test("redirect", async ({ page }) => {
await page.goto("/");
await page.click('[href="/about"]');
expect(page.waitForURL("**/redirected"));
await page.waitForURL("**/redirected");
expect(await page.textContent("h1")).toContain("Redirected");
});

test("rewrite", async ({ page }) => {
await page.goto("/");
await page.click('[href="/another"]');
expect(page.waitForURL("**/another"));
await page.waitForURL("**/another");
expect(await page.textContent("h1")).toContain("Rewrite");
});

test("no matching middleware", async ({ page }) => {
await page.goto("/");
await page.click('[href="/about2"]');
expect(page.waitForURL("**/about2"));
await page.waitForURL("**/about2");
expect(await page.textContent("h1")).toContain("About 2");
});

test("matching noop middleware", async ({ page }) => {
await page.goto("/");
await page.click('[href="/middleware"]');
expect(page.waitForURL("**/middleware"));
await page.waitForURL("**/middleware");
expect(await page.textContent("h1")).toContain("Via middleware");
});

Expand Down

0 comments on commit fa1d9b9

Please sign in to comment.