web-testing-vue-test-utils
Vue Test Utils Patterns
Quick Guide: Test Vue components with
mount()for full rendering orshallowMount()for isolation. Usewrapper.find()with data-test attributes,await trigger()for events,await setValue()for inputs. UseflushPromises()for async operations. Mock Pinia stores withcreateTestingPinia().
<critical_requirements>
CRITICAL: Before Using This Skill
All code must follow project conventions in CLAUDE.md (kebab-case, named exports, import ordering,
import type, named constants)
(You MUST await all DOM-updating methods: trigger(), setValue(), setProps(), setData())
(You MUST use flushPromises() after async operations that Vue doesn't track (API calls, timers))
(You MUST use mount() by default - only use shallowMount() for performance issues or complex isolation)
(You MUST use data-test attributes for selectors, NOT classes or IDs)