diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index 8725a7b41b..8cb98d2c5f 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -119,6 +119,8 @@ export default async function RootLayout({ children }: { children: React.ReactNo return ( { } const html = embedIframe.locator("html"); // Expect "light" theme as configured in App for pro user. - await expect(html).toHaveAttribute("class", "light"); + await expect(html).toHaveClass(/light/); const { uid: bookingId } = await bookFirstEvent("pro", embedIframe, page); const booking = await getBooking(bookingId); expect(booking.attendees.length).toBe(3); @@ -187,7 +187,8 @@ test.describe("Popup Tests", () => { return window.matchMedia("(prefers-color-scheme: dark)").matches; }); // Detect browser preference and expect accordingly - await expect(html).toHaveAttribute("class", prefersDarkScheme ? "dark" : "light"); + + prefersDarkScheme ? await expect(html).toHaveClass(/dark/) : await expect(html).toHaveClass(/light/); }); test("should open embed iframe(Booker Profile Page) with dark theme when configured with dark theme using Embed API", async ({ @@ -210,7 +211,7 @@ test.describe("Popup Tests", () => { } const html = embedIframe.locator("html"); - await expect(html).toHaveAttribute("class", "dark"); + await expect(html).toHaveClass(/dark/); }); test("should open embed iframe(Event Booking Page) with dark theme when configured with dark theme using Embed API", async ({ @@ -233,7 +234,7 @@ test.describe("Popup Tests", () => { } const html = embedIframe.locator("html"); - await expect(html).toHaveAttribute("class", "dark"); + await expect(html).toHaveClass(/dark/); }); }); });