Browse Source

fix prevent default unit test (#5127)

dev
kingwl 8 years ago
committed by Evan You
parent
commit
2e1e809467
  1. 13
      test/unit/features/directives/on.spec.js

13
test/unit/features/directives/on.spec.js

@ -86,15 +86,14 @@ describe('Directive v-on', () => {
vm = new Vue({
el,
template: `
<div @click="bar">
<div @click.stop="foo"></div>
</div>
<input type="checkbox" ref="input" @click.prevent="foo">
`,
methods: { foo: spy, bar: spy2 }
methods: { foo: spy2 }
})
triggerEvent(vm.$el.firstChild, 'click')
expect(spy).toHaveBeenCalled()
expect(spy2).not.toHaveBeenCalled()
vm.$refs.input.checked = false
triggerEvent(vm.$refs.input, 'click')
expect(spy2).toHaveBeenCalled()
expect(vm.$refs.input.checked).toBe(false)
})
it('should support capture', () => {

Loading…
Cancel
Save