Skip to content

Commit

Permalink
Add repro case for issue 1757
Browse files Browse the repository at this point in the history
  • Loading branch information
n8agrin committed Jan 20, 2023
1 parent 3f878a8 commit 9984f14
Showing 1 changed file with 153 additions and 12 deletions.
165 changes: 153 additions & 12 deletions integration/bug-report-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,24 @@ test.beforeAll(async () => {
////////////////////////////////////////////////////////////////////////////
files: {
"app/routes/index.jsx": js`
import { json } from "@remix-run/node";
import { useLoaderData, Link } from "@remix-run/react";
export function loader() {
return json("pizza");
}
import { Link } from "@remix-run/react";
export default function Index() {
let data = useLoaderData();
return (
<div>
{data}
<Link to="/burgers">Other Route</Link>
<div>pizza</div>
<Link to="/burgers">burger link</Link>
</div>
)
}
`,

"app/routes/burgers.jsx": js`
export default function Index() {
return <div>cheeseburger</div>;
return (
<div>cheeseburger</div>
);
}
`,
},
Expand All @@ -88,14 +85,158 @@ test.afterAll(() => appFixture.close());
test("[description of what you expect it to do]", async ({ page }) => {
let app = new PlaywrightFixture(appFixture, page);
// You can test any request your app might get using `fixture`.
let response = await fixture.requestDocument("/");
expect(await response.text()).toMatch("pizza");
// let response = await fixture.requestDocument("/");
// expect(await response.text()).toMatch("pizza");

// If you need to test interactivity use the `app`
await app.goto("/");
await app.clickLink("/burgers");
expect(await app.getHtml()).toMatch("cheeseburger");

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

await page.goBack({ waitUntil: "commit" });
await page.goBack({ waitUntil: "networkidle" });
await page.goForward({ waitUntil: "commit" });
await page.goForward({ waitUntil: "commit" });
expect(await app.getHtml()).not.toContain(
`Cannot destructure property 'default'`
);

// If you're not sure what's going on, you can "poke" the app, it'll
// automatically open up in your browser for 20 seconds, so be quick!
// await app.poke(20);
Expand Down

0 comments on commit 9984f14

Please sign in to comment.