Checkout — Story Report
5 scenarios · 2 passed · 1 failed · 1 skipped · 1 pending
- Started
- 29/05/2024, 17:26:40
- Duration
- 2.40 s
- Version
- 1.4.0
- Commit
- a1b2c3d
Checkout
src/checkout/checkout.story.test.ts
Checkout caps the loyalty discount at 30%
1.24 sPassed
- checkout
- pricing
- smoke
- SHOP-101
- SHOP-204
- Givena cart with 3 items totaling "$120.00"120 ms
Seeded from the standard fixture cart.
- Whena loyalty discount of 45% is applied80 ms
- Requested discount
- 0.45
Pricing call const total = applyDiscount(cart, { loyalty: 0.45 }); - Thenthe discount is capped at 30%40 ms
Discount tiers Requested Applied Saving 20% 20% $24.00 45% 30% $36.00
Why this rule exists
Loyalty stacking used to let a few accounts reach negative totals. The cap keeps margins safe — see the pricing policy.
- regression-guard
- finance-approved
flowchart LR Cart --> Loyalty --> Cap[Cap at 30%] --> Total
Trace (3 spans, 1.24 s)
- POST /checkout1.24 s
- db.cart.load95 ms
- pricing.applyDiscount80 ms
Checkout is blocked when the card is declined
610 msFailed
- checkout
- payments
- SHOP-318
expected order to be undefined but received { id: 'ord_91' }- Givena customer whose card will be declined90 ms
- Whenthey submit the order200 ms
- Thenno order is created60 ms
expected order to be undefined but received { id: 'ord_91' }- Gateway response
- {"code":"declined","retriable":false}
Trace (2 spans, 610 ms)
- POST /checkout610 ms
- payments.charge410 ms
Gift wrapping is offered above the free-wrap threshold
Skipped
- checkout
- wip
- Givena cart above the threshold
Skipped until the gift-wrap service ships (SHOP-400).
Search
src/search/search.story.test.ts
Search tolerates a single typo
Pending
- search
- fuzzy
- Giventhe catalogue is indexed
Pending: fuzzy ranking is still being tuned.
Search results render rich media and embeds
500 msPassed
- search
- ui
- SHOP-512
- Givena query that matches one product120 ms
- Thenthe result card renders380 ms

ranking-debug
{
"query": "wireles mouse",
"topScore": 0.94,
"corrected": "wireless mouse"
}