Added a /recipes page where a cook pastes a plain-text recipe, asks… #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "osf/72-172-comparison-arm-parallel-2-scale"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What was done
How to review
npx vitest run— it starts the bundled Postgres ifDATABASE_URLis not set, and the new tests for reading, scaling, converting, the shopping list, the page, and the routes should all pass.DATABASE_URLat a reachable Postgres (as in the README), start it withnpm start, and open/recipes— pasteServes 2,200 g flour,2 eggs, enter4, choose US, andShow recipeshould read14 oz flourand4 eggswhileAdd to listadds the same lines under the shopping list.npx playwright install chromium, then runnpm run test:e2e(with the same reachable Postgres) — the two recipes-page scenarios should pass among the rest, the first on the doubled US output with its reported bad line and the second on the list summing to6 eggsand14 oz flour.src/pages.tsandsrc/server.tsfirst for the form and its routes, thensrc/scale.tsandsrc/convert.tsfor the two transforms the page is built on.Code review
Reviewed the scale-recipes-and-shopping-list change (src/recipe.ts, src/scale.ts, src/convert.ts, src/shopping.ts, the /recipes page and routes, and its seven test files) against the proposal, delta specs, design and tasks. The implementation matches every spec scenario I traced by hand: the reader (mixed numbers, zero and zero-denominator quantities, one plural s on units, line numbering over blank lines), the twelfths rounding with ties to the smaller, the unit ladders (kg/l/lb from 1, tbsp from 1, cup from 1/4), the name-keyed shopping list with its unit ordering, and the page (routes placed before the /
branch, form values kept, hidden list fields with six-decimal quantities, every user-controlled value escaped including attribute values). All spec scenarios are covered by tagged tests; tsc --noEmit, openspec validate --strict, the release-notes check, and playwright --list all pass; no generated, cached or secret files are in the commit. No fixes were needed.It found nothing to fix.
Tests
All 47 scenarios of
scale-recipes-and-shopping-listhave a tagged test.The test lint found, in the run's tests on the last check:
Recorded, not decided
e2e/recipes.spec.ts:1B7: no relative import: this file asserts on things it constructed itself, which is the measured 'asserted on my own mock' failuretest/recipes-page.test.ts:1B7: nothing imported here looks like the module under test ('recipes-page')test/recipes-server.test.ts:1B7: nothing imported here looks like the module under test ('recipes-server')Braid run
scale-recipes-and-shopping-list(23 steps)366f4cf03fOpened by Braid.
Scale a recipe, convert its units, and build a shopping listto Added a /recipes page where a cook pastes a plain-text recipe, asks…366f4cf03f8ecc2a30c1