Feature: Onboarding wizard As a newly signed-up user I want to set my preferences (diet + allergens), then my household So that my profile is ready before I start planning meals # Order since #129: compte -> régime -> allergènes -> foyer -> sources, # and the sources step only when the foyer step *created* a household # (joining one or skipping ends the wizard at the home page). Background: Given the planning request returns nothing Scenario: Walks through every step, creating a household (which surfaces the sources step), and lands on the home page Given the diets reference list has options And selecting the diet will succeed And the household request returns no household And the allergies reference list has options And updating allergies will succeed And creating a household will succeed And the sources reference list has options And the household's enabled sources are empty And saving the source selection will succeed And I have signed up Then the URL should include "/onboarding/regime" And I should see "Étape 1 sur 3" When I select "Végétarien" from the "diet" field And I click the button "Continuer" Then the diet update request should have been made with diet id 2 And the URL should include "/onboarding/allergenes" And I should see "Étape 2 sur 3" And I should see the section "Allergies" And I should see the section "Intolérances" When I check the checkbox "Arachides" And I click the button "Continuer" Then the allergies update request should have been made with allergy id 1 And the URL should include "/onboarding/foyer" And I should see "Étape 3 sur 3" When I fill in the "houseName" field with "Chez Alice" And I click the button "Créer" Then the household creation request should have been made with name "Chez Alice" And the URL should include "/onboarding/sources" And I should see "Étape 4 sur 4" And I should see the section "Sources disponibles" And I should see "TheMealDB" When I check the checkbox "TheMealDB" And I click the button "Terminer" Then the source selection update request should have been made with source id 1 And the URL should be the home page And I should see the heading "Planning de la semaine" Scenario: Lets the preferences steps be skipped without changing anything, then skips the household step too Given the diets reference list is empty And selecting the diet will succeed And the household request returns no household And the allergies reference list is empty And updating allergies will succeed And I have signed up Then the URL should include "/onboarding/regime" When I click the button "Continuer" Then the diet update request should have been made with no diet id And the URL should include "/onboarding/allergenes" When I click the button "Continuer" Then the allergies update request should have been made with no allergy ids And the URL should include "/onboarding/foyer" When I click the button "Passer cette étape" Then the URL should be the home page Scenario: Creating a household with no sources implemented ends the wizard through the silently-skipped sources step Given the diets reference list is empty And selecting the diet will succeed And the household request returns no household And creating a household will succeed And the sources reference list is empty And the allergies reference list is empty And updating allergies will succeed And I have signed up When I click the button "Continuer" Then the URL should include "/onboarding/allergenes" When I click the button "Continuer" Then the URL should include "/onboarding/foyer" When I fill in the "houseName" field with "Chez Alice" And I click the button "Créer" Then the household creation request should have been made with name "Chez Alice" And the URL should be the home page Scenario: Joining an existing household skips the sources step entirely and ends the wizard Given the diets reference list is empty And selecting the diet will succeed And the household request returns no household And joining a household will succeed And the sources reference list is empty And the allergies reference list is empty And updating allergies will succeed And I have signed up When I click the button "Continuer" Then the URL should include "/onboarding/allergenes" When I click the button "Continuer" Then the URL should include "/onboarding/foyer" When I fill in the "inviteCode" field with "abcd2345" And I click the button "Rejoindre" Then the household join request should have been made with invite code "ABCD2345" And the URL should be the home page