I have a LoginCard component that uses Buefy's b-input component to render the email and password inputs:
<b-field label="Email">
<b-input
v-model="email"
type="email"
placeholder="Your email"
required
>
</b-input>
</b-field>
<b-field label="Password">
<b-input
v-model="password"
type="password"
password-reveal
placeholder="Your password"
required
>
</b-input>
</b-field>
And in my test I would like use something like vue-test-utils setValue method to set a value on the input, trigger that input, and have it propagate to my data model attributes for email and password.
wrapper.find('input[type="email"]').setValue('[email protected]');
wrapper.find('input[type="password"]').setValue('password');
But this doesn't work, the value doesn't get propagated.
b-inputpropagates input values to thev-model. Assuming this is for a unit test, that verification seems out of scope. If you are only intended to setupemailandpassword, you could initialize them directly (throughwrapper.vmor mounting options'propsData). - tony19loginWithmethod is called with that data. This feels like a unit test because the inputs are the username and password. Currently I'm usingsetDatato test it, but that doesn't feel right - it feels equivalent to manually setting an instance variable on a class instead of using the class's api. - Zachary Wright