batchCooking/apps/web/cypress/e2e/recipes.feature
Nicolas 6c5978dd1c
All checks were successful
CI / lint (push) Successful in 2m35s
CI / build (push) Successful in 2m38s
CI / intent-service-test (push) Successful in 4m23s
CI / e2e (push) Successful in 8m0s
CI / test (push) Successful in 15m1s
feat(recipes): refond le panneau de correction des métadonnées de tech-step
Suite à la maquette validée : redessine TechStepCorrectionPopover et ajoute
l'édition de la température, jusqu'ici la seule des 4 métadonnées sans
aucune interface (ni dans l'UI, ni côté API — voir la PR back-end empilée
sous celle-ci).

- StepDescription.tsx : le surlignage de température devient cliquable
  (un <button>, plus un <span> mort) — rouvre le popover de correction de
  la technique à laquelle il est rattaché (findTechStepForTemperature,
  résolu par span puisque la température n'a pas d'existence propre, elle
  est une métadonnée de clause comme les ingrédients/ustensiles).
- TechStepCorrectionPopover.tsx : réécrit. Les 4 sections (Technique,
  Ingrédients, Ustensiles, Température) restent toutes visibles en même
  temps — plus de bascule de tout le popover vers un sous-écran pendant
  l'ajout d'un ingrédient/ustensile/température, seule la section
  concernée affiche son propre mini-formulaire, les autres (dont le
  picker de technique) restent inchangées à côté. Le picker de technique
  se cache derrière "Changer" une fois une technique choisie (rien à
  décider une fois confirmée correcte). Chaque ingrédient/ustensile/
  température attaché s'affiche en ligne avec sa citation exacte du texte
  source (nouveau : la traçabilité vers le texte existait déjà en donnée,
  mais n'était affichée nulle part). Nouveau sélecteur à 3 modes
  (°C / Thermostat / Qualitatif) pour la température, cohérent avec le
  modèle de données (un seul des trois à la fois). Icônes SVG par
  catégorie (tag/feuille/poêle/thermomètre), même langage stroke-based
  que layouts/nav-icons.tsx.
- recipes.scss : nouveau langage visuel du popover (sections avec icône,
  lignes de métadonnées façon carte plutôt que puces, bouton "+ Ajouter"
  en pointillés plutôt qu'un lien texte, sélecteurs segmentés). Les deux
  surlignages (.step-tech-step, .step-temperature) passent de
  `cursor: help` à `cursor: pointer` — les deux sont maintenant de vrais
  déclencheurs cliquables.
- i18n : nouvelles clés (changeTechnique, temperatureSection,
  addTemperature, removeTemperature, temperatureMode.*) ; clé
  currentTechnique supprimée (le pictogramme remplace la phrase "Technique
  retenue : X") ; préfixe "+ " retiré de addIngredient/addUtensil (l'icône
  + le porte déjà visuellement).
- Tests : TechStepCorrectionPopover.cy.tsx largement réécrit (10 tests,
  dont 2 nouveaux sur la température) ; recipes.feature/recipes.ts : nouveau
  scénario Gherkin "cliquer un surlignage de température rouvre le popover
  de sa technique" (fixture Gratin dédiée), step "Changer" ajouté au
  scénario de relabel existant.

Vérifié : pnpm lint + build (shared/api/web) clean. Suites Cypress
exécutées localement (Chrome headless) : TechStepCorrectionPopover.cy.tsx
10/10, suite component complète 50/50, recipes.feature 5/5, recipes.cy.ts
8/8, recipe-sources.feature 6/6, planning-page.cy.ts 7/7. Un échec
pré-existant et sans rapport (recipe-form.feature, "Preloads an existing
recipe's ingredients when editing") reproduit identiquement avec ce
travail entièrement stashé — confirmé non lié.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-05 00:22:01 +02:00

74 lines
3.5 KiB
Gherkin
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Feature: Managing a recipe from the catalog
As a signed-in user
I want to favorite or delete one of my recipes
So that I can curate my catalog as it grows
Background:
Given I am signed in as "Alice" "Martin"
And my household id is 1
And the disliked ingredients list is empty
Scenario: Toggles a recipe's favorite from the detail panel and reflects it in the table
Given the recipe catalog contains "Omelette"
And recipe 2's detail is available
And toggling recipe 2's favorite will succeed
When I visit "/recettes/2"
Then the recipe "Omelette" should not be marked as favorite
When I click the favorite star
Then the favorite request should have been made
And the favorite star should be marked as favorite
And the recipe "Omelette" should be marked as favorite
Scenario: Highlights a detected technique in a step, with its name shown on focus
Given the recipe catalog contains "Omelette"
And recipe 2's detail is available
When I visit "/recettes/2"
Then I should see the highlighted technique "Cuire"
When I focus the highlighted technique "Cuire"
Then the tooltip should show "Cuire"
Scenario: Corrects a detected technique from its highlight, visible immediately as a manual match
Given the recipe catalog contains "Omelette"
And recipe 2's detail is available
And the tech steps reference list has options
And correcting step 2's "Cuire" match will succeed
When I visit "/recettes/2"
And I click the highlighted technique "Cuire"
Then I should see the technique correction options
When I choose "Mijoter" as the correct technique
Then the correction request should have been made
# The highlighted *word* stays "Cuire" (a relabel changes which
# technique a span means, not the literal text at that span, still
# "Cuire" in the source description) — now styled as a manual
# correction, with its tooltip naming the newly-assigned technique.
And the highlighted technique "Cuire" should be marked as a manual correction
When I focus the highlighted technique "Cuire"
Then the tooltip should show "Mijoter (correction manuelle)"
Scenario: Clicking a highlighted temperature reopens its technique's correction popover
# Same master-detail room requirement as recipes.cy.ts's own equivalent
# test — Cypress's default 1000×660 doesn't leave the detail panel
# (with the popover open below its step) enough height to show
# everything without its own scroll.
Given the viewport is 1600 by 900
And the recipe catalog contains "Gratin"
And recipe 4's detail is available
And the tech steps reference list includes preheat
When I visit "/recettes/4"
Then I should see the highlighted temperature "feu moyen"
When I click the highlighted temperature "feu moyen"
Then I should see the technique correction options
And the chosen technique should be "Préchauffer"
Scenario: Deletes a recipe after a two-step confirmation, then clears the selection
Given the recipe catalog contains "Omelette"
And recipe 2's detail is available
And deleting recipe 2 will succeed
When I visit "/recettes/2"
Then the recipe detail panel heading should be "Omelette"
When I click "Supprimer" in the recipe detail panel
And I confirm the deletion in the recipe detail panel
Then the delete request should have been made
And the URL should match the recipes list
And the recipe "Omelette" should not be visible in the table
And I should see "Sélectionnez une recette dans le tableau"