Skip to content

Commit 0f2f156

Browse files
committed
Revert "Debug failing test"
This reverts commit 0065a74.
1 parent edba687 commit 0f2f156

File tree

3 files changed

+23
-37
lines changed

3 files changed

+23
-37
lines changed

integration/middleware-test.ts

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ test.describe("Middleware", () => {
397397
appFixture.close();
398398
});
399399

400-
test.only("calls clientMiddleware for routes even without a loader", async ({
400+
test("calls clientMiddleware for routes even without a loader", async ({
401401
page,
402402
}) => {
403403
let fixture = await createFixture({
@@ -416,22 +416,18 @@ test.describe("Middleware", () => {
416416
});
417417
`,
418418
"app/routes/_index.tsx": js`
419-
import { Link, useNavigation } from 'react-router'
419+
import { Link } from 'react-router'
420420
export default function Component({ loaderData }) {
421-
return <Link to="/a/b/c">Link ({useNavigation().state})</Link>;
421+
return <Link to="/a/b/c">Link</Link>;
422422
}
423423
`,
424424
"app/routes/a.tsx": js`
425425
import { Outlet } from 'react-router'
426426
export const unstable_clientMiddleware = [
427-
({ context }) => {
428-
console.log('a client middleware')
429-
context.a = true;
430-
},
427+
({ context }) => { context.a = true; },
431428
];
432429
433430
export function clientLoader({ context }) {
434-
console.log('a client loader')
435431
return JSON.stringify(context)
436432
}
437433
@@ -463,19 +459,9 @@ test.describe("Middleware", () => {
463459

464460
let appFixture = await createAppFixture(fixture);
465461

466-
page.on("console", (msg) => {
467-
console.log("console:", msg.text());
468-
});
469-
470-
page.on("request", (req) => {
471-
console.log("req:", req.url());
472-
});
473-
474462
let app = new PlaywrightFixture(appFixture, page);
475463
await app.goto("/", true);
476464
(await page.$('a[href="/a/b/c"]'))?.click();
477-
await new Promise((r) => setTimeout(r, 1000));
478-
console.log(await app.getHtml());
479465
await page.waitForSelector("h4");
480466
expect(await page.innerText("h2")).toBe('A: {"a":true,"b":true}');
481467
expect(await page.innerText("h3")).toBe("B");

integration/playwright.config.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const config: PlaywrightTestConfig = {
2121
/* Maximum time expect() should wait for the condition to be met. */
2222
timeout: 5_000,
2323
},
24-
//forbidOnly: !!process.env.CI,
24+
forbidOnly: !!process.env.CI,
2525
retries: process.env.CI ? 3 : 0,
2626
reporter: process.env.CI ? "dot" : [["html", { open: "never" }]],
2727
use: { actionTimeout: 0 },
@@ -31,23 +31,23 @@ const config: PlaywrightTestConfig = {
3131
name: "chromium",
3232
use: devices["Desktop Chrome"],
3333
},
34-
// {
35-
// name: "webkit",
36-
// use: devices["Desktop Safari"],
37-
// },
38-
// {
39-
// name: "msedge",
40-
// use: {
41-
// ...devices["Desktop Edge"],
42-
// // Desktop Edge uses chromium by default
43-
// // https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/deviceDescriptorsSource.json#L1502
44-
// channel: "msedge",
45-
// },
46-
// },
47-
// {
48-
// name: "firefox",
49-
// use: devices["Desktop Firefox"],
50-
// },
34+
{
35+
name: "webkit",
36+
use: devices["Desktop Safari"],
37+
},
38+
{
39+
name: "msedge",
40+
use: {
41+
...devices["Desktop Edge"],
42+
// Desktop Edge uses chromium by default
43+
// https://github.com/microsoft/playwright/blob/main/packages/playwright-core/src/server/deviceDescriptorsSource.json#L1502
44+
channel: "msedge",
45+
},
46+
},
47+
{
48+
name: "firefox",
49+
use: devices["Desktop Firefox"],
50+
},
5151
],
5252
};
5353

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"test:integration:run": "pnpm playwright:integration",
2121
"test:integration": "pnpm build && pnpm test:integration:run",
2222
"posttest:integration:run": "pnpm clean:integration",
23-
"playwright:integration": "playwright test --config ./integration/playwright.config.ts middleware",
23+
"playwright:integration": "playwright test --config ./integration/playwright.config.ts",
2424
"vite-ecosystem-ci:build": "pnpm build",
2525
"vite-ecosystem-ci:before-test": "pnpm playwright install",
2626
"vite-ecosystem-ci:test": "pnpm playwright:integration --project=chromium && pnpm clean:integration",

0 commit comments

Comments
 (0)