Munch · Component library + ordering app + back office
Testing Infrastructure
Confidence to ship on a platform where a regression means a restaurant can't take orders.
- My role
- Set up and extended component and end-to-end coverage across the library and both apps
- Stack
- StorybookPlaywrightTypeScriptReact
The problem
Ordering is transactional and time-sensitive. A broken checkout at 6pm on a Friday isn't a bug report — it's lost revenue for a franchisee, in real time. Manual QA doesn't scale to that risk across a component library plus two applications.
Component level — Storybook
Every shared component documented in isolation, with its states enumerated as stories: empty, loading, error, disabled, edge-case content. This did double duty — a regression surface for developers and a reference for designers checking that what shipped matches what they drew.
Journey level — Playwright
End-to-end coverage of the flows that actually carry money and identity, login being the meatiest. The hard part wasn't writing assertions, it was controlling the environment:
- Route interception with mocked API responses, so tests exercise specific store configurations deterministically rather than depending on whatever state a shared backend happens to be in.
- CORS preflight handling in the mocks — intercepting OPTIONS requests and returning the right access-control-* headers alongside the actual response, which is the sort of detail that silently breaks a suite until you know to look for it.
- Fixture scenarios for specific business states: collection-only stores, delivery-only stores, stores outside a service area, offline stores.
Outcome
Regressions surface in CI rather than in a franchisee's Friday evening. The mocked scenarios in particular made it possible to test business states that would otherwise require manually configuring a real store to break.