Nobody has started this yet — be first.
Business impact
A user browsing "recipes I can make in 30 minutes or less" silently loses every recipe that takes exactly 30 minutes. There's no error, no crash -- the recipe just never shows up. For a recipe discovery product, that's a content-visibility bug: recipes with suspiciously round cooking times (15, 20, 30, 45, 60 minutes -- exactly the numbers people are most likely to search for) are the ones most likely to vanish from filtered results. It under-serves recipe authors (their recipe is invisible under the filter a user would most naturally reach for) and quietly shrinks search results with no way for a user to tell whether the filter is working correctly.
Problem
GET /recipes?maxCookingTime=30 is documented (README.md's endpoint table and curl walkthrough) and generally understood to mean "recipes that take at most 30 minutes." In practice, a recipe with cookingTimeMinutes: 30 is excluded from that result set -- only recipes strictly under 30 minutes come back.
Current behavior
GET /recipes?maxCookingTime=30 returns an empty result for a recipe whose cookingTimeMinutes is exactly 30, even though 30 <= 30 should include it.
Expected behavior
GET /recipes?maxCookingTime=N should return every recipe whose cookingTimeMinutes is less than or equal to N -- an inclusive boundary, matching "at most N minutes."
Steps to reproduce
cd nodejs/recipe_api npm run dev # or: docker compose up
curl -X POST http://localhost:3001/recipes -H "Content-Type: application/json" -d '{ "title": "Exactly Thirty", "cookingTimeMinutes": 30, "servings": 2, "ingredients": [{"name": "Rice", "quantity": 200, "unit": "g"}], "steps": [{"stepNumber": 1, "instruction": "Cook the rice."}] }'
curl "http://localhost:3001/recipes?maxCookingTime=30"
Why this matters
This is the kind of boundary bug that unit tests miss unless they specifically probe the edge: any test that filters with a threshold comfortably above or below the data (e.g. maxCookingTime=30 against a 25-minute recipe) will pass whether the comparison is lt or lte. The existing suite (tests/recipes.test.js, its GET /recipes?maxCookingTime=N block) does exactly that -- it never asserts the exact-match case, so it stays green despite this bug. A green suite only proves what it actually asserts.
Suggested approach
Look at the where.cookingTimeMinutes clause built inside the GET / handler in src/routes/recipes.js, right after the maxCookingTime query-param validation. Compare it against how "at most N" should read as a Prisma comparison operator, and against the sibling PATCH .../scale route in the same file, which has no such off-by-one. There's exactly one character-level operator to fix.
Acceptance criteria
Verification
npx jest --config practice-tickets/jest.config.js practice-tickets/tests/01-max-cooking-time-boundary.test.js
Hints (0/2)
Try it without hints first — the reading is the exercise.
Working on this ticket
Work on a branch named for the ticket — that's what you'll submit.
Branch off your fork
$git checkout -b fix/max-cooking-time-boundaryFix it and commit
Meet every acceptance criterion, and add a test that would have caught this.
Push the branch
$git push -u origin fix/max-cooking-time-boundarySubmit it below
Paste your fork URL and the branch name, with a short write-up of the root cause.
Questions
Ask about anything unclear in the ticket — the maintainer and anyone who has solved it can answer. Please don't post full solutions.
Sign in to ask a question or reply.
Sign indocker-entrypoint.shnpx prisma migrate deploydocker compose up --builddocker compose down -vWithout Docker: npm install, copy .env.example to .env and point DATABASE_URL at a local PostgreSQL instance, then npm run prisma:migrate:dev and npm run dev (nodemon, port 3001) or npm start.
The project's own suite (tests/recipes.test.js) runs against a real Postgres test database, not a mock -- create one, copy .env.example to .env.test and point it at that database, then run:
npm test
Work the tickets in practice-tickets/tickets/ (01 through 07); each names one Jest test in practice-tickets/tests/, run against the same real test database via practice-tickets/jest.config.js:
npx jest --config practice-tickets/jest.config.js practice-tickets/tests/01-max-cooking-time-boundary.test.js # a single ticket
./practice-tickets/run.sh # all 7, clean pass/fail summary
Fixing tickets 02 and 04 also turns two tests in the project's own npm test suite green again -- they break as a direct, expected side effect of those bugs touching shared route code the existing suite also exercises. That's expected, not a mistake in the scaffolding.
Level 1
Fix a bug
Read existing behaviour, correct it.