Feature: Recipe catalog As a signed-in user I want to browse, search, and manage my recipes in a master-detail view So that I can find a recipe and see/edit its details without leaving the list Background: Given I am signed in as "Alice" "Martin" And my household id is 1 And the disliked ingredients list is empty Scenario: Defaults to the Favoris tab and lists its recipes Given the recipe catalog defaults to the favorites tab with "Ratatouille" When I visit "/recettes" Then the recipe list request should have been made And I should see the heading "Recettes" And the active tab should be "Favoris" And the recipe "Ratatouille" should be visible in the table And the recipe "Ratatouille" should be marked as favorite And the recipe "Ratatouille" should show the diet badge "Végétarien" Scenario: Shows the empty state when a tab has no recipes Given the recipe catalog is empty When I visit "/recettes" Then I should see "Aucune recette pour le moment." Scenario: Shows an error state when the catalog fails to load Given the recipe catalog fails to load When I visit "/recettes" Then I should see "Impossible de charger" Scenario: Switches tabs, re-fetching each one's own recipes Given the recipe catalog switches between tabs When I visit "/recettes" Then the recipe list request should have been made And the recipe "Ratatouille" should be visible in the table When I click the tab "Perso" Then the active tab should be "Perso" And the recipe "Omelette" should be visible in the table And the recipe "Ratatouille" should not be visible in the table And the tab "Sources (bientôt)" should be disabled Scenario: Searches within the active tab, debounced Given the recipe catalog supports searching When I visit "/recettes" Then the recipe list request should have been made And the recipe "Ratatouille" should be visible in the table When I search for "Omel" Then the recipe "Omelette" should be visible in the table And the recipe "Ratatouille" should not be visible in the table Scenario: Opens a recipe's detail alongside the table when its row is selected Given the recipe catalog contains "Ratatouille" and "Omelette" And recipe 2's detail is available When I visit "/recettes" And I click the recipe "Omelette" in the table Then the recipe detail request should have been made And the URL should include "/recettes/2" And the recipe "Ratatouille" should be visible in the table And the selected row should be "Omelette" And the recipe detail panel heading should be "Omelette" And the recipe detail panel should show "Une omelette toute simple." And the recipe detail panel should show "Battre les œufs." And the recipe detail panel should show "Cuire à la poêle." Scenario: Shows a not-found message for a selected id the API rejects Given the recipe catalog is empty And recipe 999 does not exist When I visit "/recettes/999" Then the recipe detail panel should say the recipe doesn't exist 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: 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" Scenario: Links the new-recipe button to the recipe form Given the recipe catalog is empty When I visit "/recettes" Then the new-recipe button should link to "/recettes/nouvelle"