* feat(web): routine list toggles and hide empty Routinen section Show Routinen in the Oo side panel only when the bot has routines; remove the panel create control. Each list row gets an active switch with optimistic updates via routines.update. E2E covers visibility, toggle persistence, and updates existing routine specs to create via RPC like chat. Co-authored-by: cynarAI <cynarAI@users.noreply.github.com> * fix(web): sync lingui catalogs after routine panel UI change Co-authored-by: cynarAI <cynarAI@users.noreply.github.com> * fix(web): refresh routine list optimistically after save Co-authored-by: cynarAI <cynarAI@users.noreply.github.com> * test(e2e): wait for routine list after RPC create in golden path Co-authored-by: cynarAI <cynarAI@users.noreply.github.com> * style: format golden e2e after routine list wait Co-authored-by: cynarAI <cynarAI@users.noreply.github.com> * fix(web): show sign-up while session lookup is pending Co-authored-by: cynarAI <cynarAI@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
51 lines
1.9 KiB
TypeScript
51 lines
1.9 KiB
TypeScript
import { expect, test } from "@playwright/test";
|
|
import type { Routine } from "@rakazo/contracts";
|
|
import {
|
|
activeBotId,
|
|
completeOnboarding,
|
|
createTestRoutine,
|
|
openAgentComputerPanel,
|
|
rpc,
|
|
signup,
|
|
} from "./helpers";
|
|
|
|
test("routines section is hidden until the Oo has one, then list toggle persists", async ({
|
|
page,
|
|
}) => {
|
|
const stamp = Date.now();
|
|
await signup(page, `routine-list-${stamp}@rakazo.test`, "password12", "Routine List");
|
|
await completeOnboarding(page);
|
|
const botId = activeBotId(page);
|
|
|
|
await openAgentComputerPanel(page);
|
|
const panel = page.getByTestId("side-panel");
|
|
await expect(panel.getByText("Routines", { exact: true })).toHaveCount(0);
|
|
await expect(page.getByTestId("routine-create-button")).toHaveCount(0);
|
|
|
|
await createTestRoutine(page, botId, { name: "Morning check-in" });
|
|
await page.reload();
|
|
await openAgentComputerPanel(page);
|
|
await expect(panel.getByText("Routines", { exact: true })).toBeVisible();
|
|
await expect(page.getByRole("button", { name: /Morning check-in/ })).toBeVisible();
|
|
|
|
const toggle = page.getByTestId("routine-list-active-toggle");
|
|
await expect(toggle).toHaveAttribute("aria-checked", "true");
|
|
await expect(page.getByText("Every day", { exact: false })).toBeVisible();
|
|
|
|
const updated = page.waitForResponse(
|
|
(response) => response.url().includes("/rpc/routines/update") && response.ok(),
|
|
);
|
|
await toggle.click();
|
|
await expect(toggle).toHaveAttribute("aria-checked", "false");
|
|
await updated;
|
|
|
|
const [routine] = await rpc<Routine[]>(page, "routines/list", { botId });
|
|
expect(routine?.active).toBe(false);
|
|
await expect(page.getByText("Paused", { exact: true })).toBeVisible();
|
|
|
|
await toggle.click();
|
|
await expect(toggle).toHaveAttribute("aria-checked", "true");
|
|
const [reactivated] = await rpc<Routine[]>(page, "routines/list", { botId });
|
|
expect(reactivated?.active).toBe(true);
|
|
});
|