Skip to content

Commit

Permalink
test: fix test case for #8297
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Dec 21, 2018
1 parent 3fca527 commit 1c105fb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions test/unit/features/directives/bind.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,25 @@ describe('Directive v-bind', () => {

it('.sync modifier with kebab case event', done => {
const vm = new Vue({
template: `<test :foo-bar.sync="bar"/>`,
template: `<test ref="test" :foo-bar.sync="bar"/>`,
data: {
bar: 1
},
components: {
test: {
props: ['fooBar'],
template: `<div @click="$emit('update:foo-bar', 2)">{{ fooBar }}</div>`
template: `<div>{{ fooBar }}</div>`,
methods: {
update () {
this.$emit('update:foo-bar', 2)
}
}
}
}
}).$mount()

expect(vm.$el.textContent).toBe('1')
triggerEvent(vm.$el, 'click')
vm.$refs.test.update()
waitForUpdate(() => {
expect(vm.$el.textContent).toBe('2')
}).then(done)
Expand Down

0 comments on commit 1c105fb

Please sign in to comment.