1.0.0-beta.29
https://codesandbox.io/s/1yy71j858q
This is difficult to explain, but the test is failing, even though the proper event is being emitted, and it's causing values to change which trigger the computed property to re-run. But the values themselves are incorrect and don't match those in the unit test itself.
console.log(
'inside test, dirty/required:',
wrapper.vm.$v.email.$dirty,
wrapper.vm.$v.email.required
);
The results here are true and false as expected, though the computed property shows false and false even after the blur event is emitted.
This is a bug with sync mode.
To fix your example, set sync to false:
const wrapper = mount(HelloWorld, { sync: false })
Sync mode will be removed in the next beta version because of these kinds of bugs—see this issue for more details.
This bug will be fixed by removing sync mode (which is already in the dev branch), so I'll close this issue.
Perfect, thank you!
Most helpful comment
This is a bug with
syncmode.To fix your example, set
syncto false:Sync mode will be removed in the next beta version because of these kinds of bugs—see this issue for more details.
This bug will be fixed by removing sync mode (which is already in the dev branch), so I'll close this issue.