Skip to content

fix: #455 #661

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

Closed
wants to merge 4 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion test/specs/mounting-options/sync.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,17 @@ describeWithShallowAndMount('options.sync', (mountingMethod) => {
})

it('call updated when sync is not false', () => {
const fooSpy = sinon.stub()
const Foo = {
template: '<div>{{ foo }}</div>',
props: ['foo'],
updated () {
fooSpy()
}
}
const spy = sinon.stub()
const TestComponent = {
template: '<div>{{ foo }}</div>',
template: '<div>{{ foo }}<foo :foo="foo" /></div>',
data () {
return {
foo: 'foo'
Expand All @@ -126,10 +134,14 @@ describeWithShallowAndMount('options.sync', (mountingMethod) => {
}
}
const wrapper = mountingMethod(TestComponent, {
stubs: { foo: Foo },
sync: true
})
expect(spy.notCalled).to.equal(true)
expect(fooSpy.notCalled).to.equal(true)
wrapper.vm.foo = 'bar'
expect(spy.calledOnce).to.equal(true)
expect(fooSpy.calledOnce).to.equal(true)
expect(wrapper.html()).to.equal('<div>bar<div>bar</div></div>')
})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddyerburgh

One question with this PR—I don't think child components will call update with this solution?

Since this test passed, child components are updated.

})