From 3e67c662659fdd90fd509fe344ce004630b29bc9 Mon Sep 17 00:00:00 2001 From: Matt Brophy Date: Wed, 26 Jun 2024 10:26:29 -0400 Subject: [PATCH] Fix non-chromium e2e test assertions (Remix commit ad74d67) --- integration/root-route-test.ts | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/integration/root-route-test.ts b/integration/root-route-test.ts index c31dfd9adc..13b4b3c035 100644 --- a/integration/root-route-test.ts +++ b/integration/root-route-test.ts @@ -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; @@ -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 `
` rendered
+      expect(await app.getHtml("pre")).toMatch("color: red;");
+    }
 
     console.error = oldConsoleError;
   });
@@ -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;
@@ -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 `
` rendered
+      expect(await app.getHtml("pre")).toMatch("color: red;");
+    }
 
     console.error = oldConsoleError;
   });