evOo-local/apps/web/e2e/sidebar-nav.spec.ts
Claude 8ae07cdf11
fix(web): use English Lingui sources for German UI text
Several web surfaces hard-coded German (the project card, roster and
activity status labels, the sidebar "Heute" label) or used German text as
the Lingui source message (sidebar sections, project timeline, bot picker,
voice entry, group stage, copy and read-aloud buttons). English users saw
German, and because production builds keep only message ids, none of these
strings could be translated per locale.

Convert them to English source messages, keeping the meaning:
- ProjectCreatedCard: Lingui Trans/Plural instead of literals.
- agent-activity: labels go through i18n._ with literal ids so the module
  stays importable from plain unit tests; the extractor still collects them.
- Shell, ProjectSessionTimeline, bot-picker, StageVoiceEntry, OoStage:
  English sources, reusing existing messages where one already fit
  ("just now", "{n}m ago", "Search", "No bots match", "Set up voice",
  "Group conversation", "Transcript").
- The conversation picker matches its create entry against the translated
  label instead of a fixed German string.

The German wording returns through the de catalog in the next commit.
Unit and E2E tests now assert the English labels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MRtGG9ARfqqhma3t85Ro2u
2026-10-03 13:22:37 +00:00

57 lines
2.4 KiB
TypeScript

/**
* E2E: Sidebar navigation elements.
*
* Verifies the expected sidebar sections appear and that Integrations is gone.
*/
import { expect, test } from "@playwright/test";
import { captureScreenshot, completeOnboarding, signup } from "./helpers";
test.describe.configure({ mode: "serial" });
test("sidebar has expected navigation items and no integrations", async ({ page }) => {
const testInfo = test.info();
const stamp = Date.now();
await signup(page, `snnav-${stamp}@rakazo.test`, "password12", "SnNav");
await completeOnboarding(page);
await expect(page.getByText("Chief").first()).toBeVisible();
const sidebar = page.locator("aside").first();
await captureScreenshot(page, testInfo, "sidebar-nav-before");
// Actual sidebar structure (verified by snapshot):
// - button "Activity" (top action)
// - textbox "Search" (search input)
// - button "Today"
// - text "Talk to your Oos" (conversations section header)
// - status "Not configured" (trading bot URL unset)
// - NO "Integration(en)" button or text
// Search: it's a textbox, not a button
const searchInput = sidebar.locator('input[placeholder="Search"], textbox[name="Search"]');
await expect(searchInput).toBeVisible({ timeout: 5000 });
const todayBtn = sidebar.getByRole("button", { name: "Today", exact: true });
await expect(todayBtn).toBeVisible({ timeout: 5000 });
// "Talk to your Oos" is plain text, not a button
const conversationsText = sidebar.getByText("Talk to your Oos");
await expect(conversationsText).toBeVisible({ timeout: 5000 });
// Trading mode comes from the bot API. With no URL configured the sidebar
// must not claim Live Trading from a local preference.
const tradingStatus = sidebar.getByTestId("trading-mode-status");
await expect(tradingStatus).toBeVisible({ timeout: 5000 });
await expect(tradingStatus).toContainText("Not configured");
await expect(sidebar.getByRole("button", { name: "Live Trading" })).toHaveCount(0);
// No "Integration(en)" button
const integrationBtn = sidebar.getByRole("button", { name: /Integration(en)?/i });
await expect(integrationBtn).toHaveCount(0, { timeout: 5000 });
// No "Integration(en)" text anywhere in sidebar
const integrationText = sidebar.getByText(/Integration(en)?/i);
await expect(integrationText).toHaveCount(0, { timeout: 5000 });
await captureScreenshot(page, testInfo, "sidebar-nav-after");
});