cartStore has no tests: add/remove/total logic is uncovered
Labels / Complexity: testing · Trivial — Trivial
Summary
cartStore (src/store/cartStore.ts) manages the purchase cart (add, remove, totals). It has no tests. A regression that double-counts totals or fails to remove items ships silently in the checkout flow.
Proposal
- Add a spec covering add, remove, quantity updates, and total calculations (including empty-cart and duplicate-add edge cases).
Acceptance criteria
- The spec asserts cart mutations and totals; it passes via
npm test.
Getting started
src/store/cartStore.ts — the store
src/store/__tests__/transactionStore.test.ts — the pattern
Commands: npm test.
Good first files to read: src/store/cartStore.ts.
cartStore has no tests: add/remove/total logic is uncovered
Labels / Complexity: testing · Trivial — Trivial
Summary
cartStore(src/store/cartStore.ts) manages the purchase cart (add, remove, totals). It has no tests. A regression that double-counts totals or fails to remove items ships silently in the checkout flow.Proposal
Acceptance criteria
npm test.Getting started
src/store/cartStore.ts— the storesrc/store/__tests__/transactionStore.test.ts— the patternCommands:
npm test.Good first files to read:
src/store/cartStore.ts.