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

test: demonstrate setProps bug through computed and created (#738) #820

Closed

Conversation

agriffis
Copy link

No description provided.

@eddyerburgh
Copy link
Member

Thanks for the bug repro!

This is a bug with the synchronous implementation that changed in beta.16 (#676).

This is a very serious issue that I'm focussed on fixing.

The solution at the moment (and possibly the long term solution) is to run the tests without sync mode:

it('sets component prop referenced through computed and created', () => {
  const wrapper = mountingMethod(ComponentWithComputedCreated, {propsData: {prop1: 1}, sync: false})
  wrapper.setProps({prop1: 2})
  setTimeout(() => {
    expect(wrapper.vm.prop1).to.equal(2)
  })
}) 

@agriffis agriffis force-pushed the 738-setprops-with-computed-created branch from b6e1d9c to b3f89c5 Compare August 24, 2018 19:40
@agriffis agriffis force-pushed the 738-setprops-with-computed-created branch from b3f89c5 to 2a01b81 Compare August 27, 2018 22:51
@agriffis
Copy link
Author

@eddyerburgh Just for kicks, I rebased this to latest and it's great to see it works!

@leifriksheim
Copy link

leifriksheim commented Sep 6, 2018

In my case using setTimeout will make all test pass, even if they shouldn't

@eddyerburgh
Copy link
Member

This should be fixed in beta.29

@eddyerburgh eddyerburgh closed this Feb 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants