Skip to content

Commit

Permalink
Fix non-chromium e2e test assertions (Remix commit ad74d67)
Browse files Browse the repository at this point in the history
  • Loading branch information
brophdawg11 committed Jun 26, 2024
1 parent 716cb3a commit 3e67c66
Showing 1 changed file with 21 additions and 6 deletions.
27 changes: 21 additions & 6 deletions integration/root-route-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ test.describe("root route", () => {

test("Skip the Layout on subsequent client renders if Layout/ErrorBoundary throws (async)", async ({
page,
browserName,
}) => {
let oldConsoleError;
oldConsoleError = console.error;
Expand Down Expand Up @@ -271,9 +272,15 @@ test.describe("root route", () => {
expect(await app.page.$("#layout")).toBeNull();
expect(await app.getHtml("title")).toMatch("Application Error");
expect(await app.getHtml("h1")).toMatch("Application Error");
expect(await app.getHtml("pre")).toMatch(
"TypeError: Cannot read properties of null"
);
if (browserName === "chromium") {
expect(await app.getHtml("pre")).toMatch(
"TypeError: Cannot read properties of null"
);
} else {
// Other browsers don't include the error message in the stack trace so just
// ensure we get the `<pre>` rendered
expect(await app.getHtml("pre")).toMatch("color: red;");
}

console.error = oldConsoleError;
});
Expand Down Expand Up @@ -335,6 +342,7 @@ test.describe("root route", () => {

test("Skip the Layout on subsequent client renders if the Layout/DefaultErrorBoundary throws (async)", async ({
page,
browserName,
}) => {
let oldConsoleError;
oldConsoleError = console.error;
Expand Down Expand Up @@ -391,9 +399,16 @@ test.describe("root route", () => {
expect(await app.page.$("#layout")).toBeNull();
expect(await app.getHtml("title")).toMatch("Application Error");
expect(await app.getHtml("h1")).toMatch("Application Error");
expect(await app.getHtml("pre")).toMatch(
"TypeError: Cannot read properties of null"
);

if (browserName === "chromium") {
expect(await app.getHtml("pre")).toMatch(
"TypeError: Cannot read properties of null"
);
} else {
// Other browsers don't include the error message in the stack trace so just
// ensure we get the `<pre>` rendered
expect(await app.getHtml("pre")).toMatch("color: red;");
}

console.error = oldConsoleError;
});
Expand Down

0 comments on commit 3e67c66

Please sign in to comment.