Hydra
Bug library · state · state

Off-by-one quantity

The + button increments the cart line one row below the one clicked.

Breaks: main, holdout · expected from Kane: caught · The main spec checks both line quantities after one + click.

The diff

components/Checkout.tsx
- setLines((current) => current.map((l, i) => (i === index ? { ...l, qty: Math.min(MAX_QTY, l.qty + 1) } : l)));
+ setLines((current) => current.map((l, i) => (i === index + 1 ? { ...l, qty: Math.min(MAX_QTY, l.qty + 1) } : l)));

Matches

No recorded match has planted this bug yet.