batchCooking/apps/web/cypress/e2e/cooking-session.feature
Nicolas dfe0310b63
Some checks failed
CI / lint (push) Successful in 2m16s
CI / build (push) Successful in 3m11s
CI / e2e (push) Successful in 7m53s
CI / intent-service-test (push) Successful in 13m57s
CI / test (push) Failing after 17m23s
feat(cooking-session): onglets recettes/plan + stepper d'étapes cochables
Remanie /cuisiner : au lieu d'empiler toutes les phases, deux onglets
(Recettes, Plan) et un stepper qui parcourt les phases une à une. Chaque
tâche est cochable ; la progression est mémorisée par semaine dans
localStorage — aucun état serveur, même parti pris que le reste de la page.

- CookingSessionPage : barre d'onglets + PlanTab (stepper, nav
  précédent/suivant, clic direct sur un nœud) + RecipesTab (liste des
  recettes de la semaine, lien vers la fiche)
- cooking-progress.ts : CookingProgressStore (load/save localStorage,
  clé batchcooking:cookingProgress:<semaine>)
- cooking-session.ts : reconcileChecked / phaseProgress (helpers purs)
- réutilise CheckboxOption pour les cartes de tâche cochables
- i18n : cookingSession.tabs / stepper / progress / recipesTab
- tests Cypress (mode layout + Gherkin) mis à jour et étendus

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-03 09:12:08 +02:00

55 lines
2.7 KiB
Gherkin

Feature: Start cooking an optimized plan
As a member of a household with a planned week
I want to open an optimized cooking plan from my planning
So that shared preparation is pooled and I cook the week efficiently
Background:
Given I am signed in as "Alice" "Martin"
And my household id is 1
And today is frozen at "2026-08-17T09:00:00.000Z"
Scenario: The "Commencer à cuisiner" button is disabled while the week is empty
Given the planning request returns nothing
When I visit "/"
Then the "Commencer à cuisiner" button should be disabled
Scenario: Opening the plan from the planning shows the pooled prep in mise en place
Given the planning for this week has recipes "Soupe à l'oignon" and "Tarte à l'oignon"
And the cooking plan for "2026-08-17" pools "Hacher" of "Oignon" across both recipes
When I visit "/"
And I click the button "Commencer à cuisiner"
Then the URL should include "/cuisiner"
And I should see "Mise en place"
And the pooled prep task should mention "Hacher" and "Oignon"
And the pooled prep task should be flagged as shared
Scenario: The stepper walks the phases one at a time
Given the planning for this week has recipes "Soupe à l'oignon" and "Tarte à l'oignon"
And the cooking plan for "2026-08-17" has a mise en place then a cooking step
When I visit "/cuisiner?date=2026-08-17"
Then the current cooking step should be "Étape 1 / 2"
And I should not see "Faire mijoter le bouillon"
When I go to the next cooking step
Then the current cooking step should be "Étape 2 / 2"
And I should see "Faire mijoter le bouillon"
When I go to the previous cooking step
Then the current cooking step should be "Étape 1 / 2"
Scenario: A ticked task stays ticked while moving through the stepper
Given the planning for this week has recipes "Soupe à l'oignon" and "Tarte à l'oignon"
And the cooking plan for "2026-08-17" has a mise en place then a cooking step
When I visit "/cuisiner?date=2026-08-17"
And I tick the cooking task "Hacher"
Then the cooking task "Hacher" should be done
When I go to the next cooking step
And I go to the previous cooking step
Then the cooking task "Hacher" should be done
Scenario: The Recettes tab lists the week's planned recipes
Given the planning for this week has recipes "Soupe à l'oignon" and "Tarte à l'oignon"
And the cooking plan for "2026-08-17" has a mise en place then a cooking step
When I visit "/cuisiner?date=2026-08-17"
And I open the "Recettes" cooking tab
Then I should see "Soupe à l'oignon"
And the recipe "Soupe à l'oignon" should link to "/recettes/1"
And the recipe "Tarte à l'oignon" should link to "/recettes/2"