diff --git a/apps/web/cypress/e2e/auth.cy.ts b/apps/web/cypress/e2e/auth.cy.ts index 0f5db35..40250ac 100644 --- a/apps/web/cypress/e2e/auth.cy.ts +++ b/apps/web/cypress/e2e/auth.cy.ts @@ -6,9 +6,14 @@ import { ErrorCode } from "@batch-cooking/shared"; // suites against a real database. describe("Signup", () => { - it("creates a profile and lands on the home page", () => { + it("creates a profile and starts the onboarding wizard (household/regime/allergens)", () => { cy.intercept("GET", "**/auth/me", { statusCode: 401 }); - cy.intercept("GET", "**/planning/current", { statusCode: 200, body: null }); + // The onboarding wizard's first step (see onboarding.cy.ts for the full + // walkthrough) reads the household right away to prefill its name field. + cy.intercept("GET", "**/house/current", { + statusCode: 200, + body: { id: 1, name: "Foyer de Alice" }, + }); cy.intercept("POST", "**/auth/signup", { statusCode: 201, body: { @@ -30,8 +35,11 @@ describe("Signup", () => { cy.contains("button", "Créer mon profil").click(); cy.wait("@signup"); - cy.url().should("not.include", "/signup"); - cy.contains("Bonjour Alice").should("be.visible"); + // Not the home page directly — signup hands off to the onboarding + // wizard first (RedirectIfAuthenticated no longer applies here, it's a + // RequireAuth-gated route of its own, see App.tsx). + cy.url().should("include", "/onboarding/foyer"); + cy.get("#houseName").should("have.value", "Foyer de Alice"); }); it("shows a client-side validation error without calling the API", () => {