Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component references in computed property don't match test #1148

Closed
ffxsam opened this issue Feb 13, 2019 · 2 comments
Closed

Component references in computed property don't match test #1148

ffxsam opened this issue Feb 13, 2019 · 2 comments
Labels

Comments

@ffxsam
Copy link

ffxsam commented Feb 13, 2019

Version

1.0.0-beta.29

Reproduction link

https://codesandbox.io/s/1yy71j858q

Steps to reproduce

  1. Run tests

What is expected?

  1. Test should pass

What is actually happening?

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.

@eddyerburgh
Copy link
Member

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.

@ffxsam
Copy link
Author

ffxsam commented Feb 14, 2019

Perfect, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants