Files
famapp/tests/e2e/assistant.spec.ts
T
ginnoir e5e509081c
CI / checks (push) Failing after 2m12s
CI / build (push) Successful in 4m50s
feat: per-user assistant name and system prompt customization
Each user can rename the AI assistant and edit their own system prompt in Settings.
2026-07-04 23:26:17 -05:00

31 lines
1.3 KiB
TypeScript

import { expect, test } from "@playwright/test";
test("assistant bubble is hidden until opted in", async ({ page }) => {
await page.goto("/");
await expect(page.getByRole("button", { name: "Open assistant" })).toHaveCount(0);
});
test("assistant chat smoke after opt-in", async ({ page }) => {
await page.goto("/settings?s=appearance");
const assistantSwitch = page.getByRole("switch", { name: "AI assistant" });
if (!(await assistantSwitch.isChecked())) {
await assistantSwitch.click();
}
await page.goto("/");
await page.getByRole("button", { name: "Open assistant" }).click();
await expect(page.getByRole("dialog", { name: "Assistant" })).toBeVisible();
await page.getByLabel("Message for Assistant").fill("hello assistant");
await page.getByRole("button", { name: "Send" }).click();
await expect(page.getByText("hello assistant")).toBeVisible();
const dialog = page.getByRole("dialog", { name: "Assistant" });
await expect(dialog.locator(".animate-spin").first()).toBeVisible({ timeout: 5000 });
await expect(dialog.locator(".animate-spin")).toHaveCount(0, { timeout: 30_000 });
await page.reload();
await page.getByRole("button", { name: "Open assistant" }).click();
await expect(page.getByText("hello assistant")).toBeVisible();
});