Skip to content

Commit

Permalink
Merge remote-tracking branch 'remix/migration-src' into migration-dest
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Mar 27, 2024
2 parents e977d54 + 16f17f0 commit 4fa24c1
Show file tree
Hide file tree
Showing 411 changed files with 68,888 additions and 0 deletions.
15 changes: 15 additions & 0 deletions integration/CHANGELOG.md
@@ -0,0 +1,15 @@
# integration-tests

## 0.0.0

### Minor Changes

- Unstable Vite support for Node-based Remix apps ([#7590](https://github.com/remix-run/remix/pull/7590))

- `remix build` 👉 `vite build && vite build --ssr`
- `remix dev` 👉 `vite dev`

Other runtimes (e.g. Deno, Cloudflare) not yet supported.
Custom server (e.g. Express) not yet supported.

See "Future > Vite" in the Remix Docs for details.
66 changes: 66 additions & 0 deletions integration/abort-signal-test.ts
@@ -0,0 +1,66 @@
import { test } from "@playwright/test";

import { PlaywrightFixture } from "./helpers/playwright-fixture.js";
import type { Fixture, AppFixture } from "./helpers/create-fixture.js";
import {
createAppFixture,
createFixture,
js,
} from "./helpers/create-fixture.js";

let fixture: Fixture;
let appFixture: AppFixture;

test.beforeAll(async () => {
fixture = await createFixture({
files: {
"app/routes/_index.tsx": js`
import { json } from "@remix-run/node";
import { useActionData, useLoaderData, Form } from "@remix-run/react";
export async function action ({ request }) {
// New event loop causes express request to close
await new Promise(r => setTimeout(r, 0));
return json({ aborted: request.signal.aborted });
}
export function loader({ request }) {
return json({ aborted: request.signal.aborted });
}
export default function Index() {
let actionData = useActionData();
let data = useLoaderData();
return (
<div>
<p className="action">{actionData ? String(actionData.aborted) : "empty"}</p>
<p className="loader">{String(data.aborted)}</p>
<Form method="post">
<button type="submit">Submit</button>
</Form>
</div>
)
}
`,
},
});

// This creates an interactive app using playwright.
appFixture = await createAppFixture(fixture);
});

test.afterAll(() => {
appFixture.close();
});

test("should not abort the request in a new event loop", async ({ page }) => {
let app = new PlaywrightFixture(appFixture, page);
await app.goto("/");
await page.waitForSelector(`.action:has-text("empty")`);
await page.waitForSelector(`.loader:has-text("false")`);

await app.clickElement('button[type="submit"]');

await page.waitForSelector(`.action:has-text("false")`);
await page.waitForSelector(`.loader:has-text("false")`);
});

0 comments on commit 4fa24c1

Please sign in to comment.