We may not need component (unit) testing
summary
Argues that component unit tests aren’t always necessary and compares Vitest + Vue Test Utils (fast, easy mocking of composables, used to run three unit tests for the cart and three for the search) with Playwright component testing (runs in real browser, verifies styling and router sync but lacks easy mocking). Uses a pizza-store demo (cart, gallery, search) and finds: unit tests cover composable logic, Playwright catches visual/URL issues; avoid duplicating tests and pick Vitest for isolated logic, Playwright for visual or integration behavior.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:48Testing layers and component testing
- 5:25Small vs large components
- 7:13Unit vs integration for components
- 9:43Setting up the demo environment
- 11:09Card component with Vest
- 17:57Card component with Playwright
- 22:35Search component with Vest
- 28:40Search component with Playwright
- 31:58Summary
- 34:47Q&A
related talks
26mWe May Not Need Component Testing
13mComponent Testing with Playwright for Vue
28mTestable Nuxt
34mComponent testing with Vitest
24mWriting Good Tests for Vue Applications
24mCost-Effective Testing with Storybook and Playwright in Vue Applications
32mPlaywright Component Tests: Are they the Testing-Library killer?
20mComponent Testing with Playwright
