evOo-local/apps/web/e2e/onboarding-intake-de.spec.ts
Cursor Agent a5ef5dc5ce
feat(web): Phase 2 production readiness — locale, mobile, E2E matrix
Localize onboarding focus facts by profile locale (DE assertion).
Add mobile overflow/touch audits, deep-link matrix, extended console
checks, and E2E for empty project, session unavailable, and teaching
composer. Safe-area and Heute header layout on 390px viewports.

Co-authored-by: cynarAI <cynarAI@users.noreply.github.com>
2026-10-07 09:31:52 +00:00

31 lines
1.4 KiB
TypeScript

import { expect, test } from "@playwright/test";
import { completeOnboarding, openUserSettings, rpc, signup } from "./helpers";
test.use({ viewport: { width: 390, height: 844 }, isMobile: true, hasTouch: true });
test("German UI localizes goal placeholder and question in intake", async ({ page }) => {
await page.addInitScript(() => {
Object.defineProperty(navigator, "language", { value: "de-DE", configurable: true });
localStorage.setItem("rakazo.uiLocale", "de");
});
const stamp = Date.now();
await signup(page, `intake-de-${stamp}@rakazo.test`, "password12", "Deutsch Intake");
await completeOnboarding(page, undefined, { mainConversation: true });
await rpc(page, "profile/update", { locale: "de-DE", language: "de" });
await page.getByTestId("focus-choice-day").click();
const goal = page.locator('[data-testid="choice-card"][data-step="goal"]');
await expect(goal).toContainText("Was möchtest du in den nächsten Wochen erledigt bekommen?");
await expect(
goal.getByRole("textbox", {
name: "Was möchtest du in den nächsten Wochen erledigt bekommen?",
}),
).toHaveAttribute("placeholder", "Dein Ziel");
const settings = await openUserSettings(page);
const profile = settings.getByTestId("user-profile-settings");
await expect(profile.getByTestId("user-facts-goals")).toContainText(
"Möchte zuerst bei der täglichen Arbeit unterstützt werden",
);
});