From 264c3a7edba38b35d20c7668961a2955f3f9d22a Mon Sep 17 00:00:00 2001 From: vince Date: Sat, 20 Jun 2026 01:13:33 +0200 Subject: [PATCH] test(ui): rebuild storybook before e2e --- playwright.config.ts | 2 +- tests/e2e/storybook.spec.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/playwright.config.ts b/playwright.config.ts index 221c1af..3593452 100644 --- a/playwright.config.ts +++ b/playwright.config.ts @@ -27,7 +27,7 @@ export default defineConfig({ timeout: 120_000, }, { - command: `[ -f storybook-static/iframe.html ] || bun run build-storybook; STORYBOOK_STATIC_PORT=${storybookPort} bun tests/e2e/storybook-server.ts`, + command: `bun run build-storybook && STORYBOOK_STATIC_PORT=${storybookPort} bun tests/e2e/storybook-server.ts`, url: storybookURL, reuseExistingServer: false, timeout: 120_000, diff --git a/tests/e2e/storybook.spec.ts b/tests/e2e/storybook.spec.ts index fda6730..7873a02 100644 --- a/tests/e2e/storybook.spec.ts +++ b/tests/e2e/storybook.spec.ts @@ -23,6 +23,10 @@ test.describe("Storybook theme QA", () => { await expect( page.getByRole("button", { name: "Switch to dark theme" }), ).toBeVisible(); + await expect(page.locator("body")).toHaveCSS( + "background-color", + "rgb(243, 245, 237)", + ); expect( consoleMessages.filter((message) => message.includes("Global args/argTypes can only be set globally"),