Skip to content

Commit c7c699e

Browse files
yyx990803hefeng
authored and
hefeng
committed
test: fix test case for vuejs#8297
1 parent c71f6ae commit c7c699e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

test/unit/features/directives/bind.spec.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -168,20 +168,25 @@ describe('Directive v-bind', () => {
168168

169169
it('.sync modifier with kebab case event', done => {
170170
const vm = new Vue({
171-
template: `<test :foo-bar.sync="bar"/>`,
171+
template: `<test ref="test" :foo-bar.sync="bar"/>`,
172172
data: {
173173
bar: 1
174174
},
175175
components: {
176176
test: {
177177
props: ['fooBar'],
178-
template: `<div @click="$emit('update:foo-bar', 2)">{{ fooBar }}</div>`
178+
template: `<div>{{ fooBar }}</div>`,
179+
methods: {
180+
update () {
181+
this.$emit('update:foo-bar', 2)
182+
}
183+
}
179184
}
180185
}
181186
}).$mount()
182187

183188
expect(vm.$el.textContent).toBe('1')
184-
triggerEvent(vm.$el, 'click')
189+
vm.$refs.test.update()
185190
waitForUpdate(() => {
186191
expect(vm.$el.textContent).toBe('2')
187192
}).then(done)

0 commit comments

Comments
 (0)