diff --git a/next.config.ts b/next.config.ts index 76f79b8..d48ee98 100644 --- a/next.config.ts +++ b/next.config.ts @@ -178,7 +178,14 @@ const nextConfig: NextConfig = { output: "standalone", // Keep pino and pino-pretty as native Node.js requires so their worker-thread // transport and stream internals work correctly inside the standalone bundle. - serverExternalPackages: ["pino", "pino-pretty", "drizzle-orm", "postgres"], + serverExternalPackages: [ + "pino", + "pino-pretty", + "drizzle-orm", + "postgres", + "isomorphic-dompurify", + "jsdom", + ], }; export default nextConfig; diff --git a/tests/e2e/assistant.spec.ts b/tests/e2e/assistant.spec.ts index c08f1ea..677cb9e 100644 --- a/tests/e2e/assistant.spec.ts +++ b/tests/e2e/assistant.spec.ts @@ -1,4 +1,13 @@ -import { expect, test } from "@playwright/test"; +import { expect, test, type Page } from "@playwright/test"; + +async function ensureSignedIn(page: Page) { + await page.goto("/"); + const devLogin = page.getByRole("button", { name: "Dev login" }); + if (await devLogin.isVisible().catch(() => false)) { + await devLogin.click(); + await page.waitForURL((url) => !url.pathname.startsWith("/login")); + } +} test("assistant bubble is hidden until opted in", async ({ page }) => { await page.goto("/"); @@ -6,11 +15,13 @@ test("assistant bubble is hidden until opted in", async ({ page }) => { }); test("assistant chat smoke after opt-in", async ({ page }) => { + await ensureSignedIn(page); await page.goto("/settings?s=appearance"); const assistantSwitch = page.getByRole("switch", { name: "AI assistant" }); if (!(await assistantSwitch.isChecked())) { await assistantSwitch.click(); } + await expect(assistantSwitch).toBeChecked(); await page.goto("/"); await page.getByRole("button", { name: "Open assistant" }).click();