ant-design-vue/components/checkbox/__tests__/checkbox.test.js

26 lines
592 B
JavaScript
Raw Normal View History

2018-05-20 13:42:23 +00:00
import { mount } from '@vue/test-utils'
import Checkbox from '..'
import focusTest from '../../../tests/shared/focusTest'
describe('Checkbox', () => {
focusTest(Checkbox)
it('responses hover events', () => {
const onMouseEnter = jest.fn()
const onMouseLeave = jest.fn()
const wrapper = mount(Checkbox, {
listeners: {
mouseenter: onMouseEnter,
mouseleave: onMouseLeave,
},
})
wrapper.trigger('mouseenter')
expect(onMouseEnter).toHaveBeenCalled()
wrapper.trigger('mouseleave')
expect(onMouseLeave).toHaveBeenCalled()
})
})