Triggering events
A component is more than its first render. It reacts to clicks and keystrokes,
and a test has to simulate those actions to check the result. @vue/test-utils
gives you helpers on the wrapper for that.
wrapper.find('button').trigger('click') dispatches a click on the element. For
form inputs, wrapper.find('input').setValue('Vue') sets the value and fires the
matching input event in one step.
await wrapper.find('input').setValue('Vue');
expect(wrapper.find('p').text()).toBe('Vue');
Both helpers return a promise, so await them. Vue updates the DOM
asynchronously: the element's text changes only after the update flushes, and
awaiting the helper waits for that flush. Assert after the await, never
before.
The events you trigger are the same ones a real user produces, so the component behaves as it would in the browser. That is what makes an interaction test trustworthy.
Your job is to wire up the input in App.vue so the Test sees the typed text.
Challenge
Typing into the input changes nothing on the page. Export an App component
from App.vue that renders an <input> bound to a text value and a <p>
showing that same value.
The Test types Vue into the input with setValue, then expects the paragraph
to read Vue. The starter renders the input but never binds it, so the
paragraph stays empty and the Test fails. Bind the two together.