All checks were successful
RequireAuth.tsx affiche deja la LandingPage publique pour un visiteur deconnecte exactement sur / (issue #41) — seul handleLogout naviguait encore explicitement vers /login. Change juste la destination de navigate() ; aucun autre changement necessaire. Scenario Cypress mis a jour en consequence (le pas existant "the URL should be the home page" suffit, pas besoin d'un nouveau pas). Verifie en local, suite complete : pnpm lint, pnpm --filter web build, pnpm run e2e (139/139, apres avoir nettoye un process vite zombie sur le port 5173 laisse par une precedente invocation cypress dans cette meme session — voir dev-environment-gotchas pour le detail). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
63 lines
2.6 KiB
Gherkin
63 lines
2.6 KiB
Gherkin
Feature: Signup and login
|
|
As a visitor
|
|
I want to create a profile or log into an existing one
|
|
So that I can access my household's batch-cooking planning
|
|
|
|
Background:
|
|
Given I am not signed in
|
|
|
|
Scenario: Signing up creates a profile and starts the onboarding wizard
|
|
Given the signup request will succeed
|
|
And the diets reference list is empty
|
|
When I sign up with:
|
|
| firstName | Alice |
|
|
| lastName | Martin |
|
|
| email | alice@example.com |
|
|
| password | correct-horse-battery-staple |
|
|
Then the signup request should have been made
|
|
And the URL should include "/onboarding/regime"
|
|
And I should see "Étape 1 sur 3"
|
|
|
|
Scenario: Signing up shows a client-side validation error without calling the API
|
|
Given the signup request is being watched
|
|
When I sign up with:
|
|
| firstName | A |
|
|
| lastName | B |
|
|
| email | a@example.com |
|
|
| password | short |
|
|
Then I should see "8 caractères minimum"
|
|
And the signup request should not have been made
|
|
|
|
Scenario: Signing up shows the API's error when the email is already taken
|
|
Given the signup request will fail because the email is already used
|
|
When I sign up with:
|
|
| firstName | Alice |
|
|
| lastName | Martin |
|
|
| email | alice@example.com |
|
|
| password | correct-horse-battery-staple |
|
|
Then the signup request should have been made
|
|
And I should see "Cet email est déjà utilisé"
|
|
|
|
Scenario: Logging in lands on the home page
|
|
Given the login request will succeed
|
|
And the planning request returns nothing
|
|
When I log in with email "alice@example.com" and password "correct-horse-battery-staple"
|
|
Then the login request should have been made
|
|
And I should see "Bonjour Alice"
|
|
|
|
Scenario: Logging in shows an error on invalid credentials
|
|
Given the login request will fail because the credentials are invalid
|
|
When I log in with email "alice@example.com" and password "wrong-password"
|
|
Then the login request should have been made
|
|
And I should see "Email ou mot de passe incorrect"
|
|
|
|
Scenario: Logging out returns to the landing page
|
|
Given I am signed in as "Alice" "Martin"
|
|
And my household id is 1
|
|
And the planning request returns nothing
|
|
And the logout request will succeed
|
|
When I visit "/"
|
|
And I open the account menu
|
|
And I click the button "Se déconnecter"
|
|
Then the logout request should have been made
|
|
And the URL should be the home page
|