mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-05 05:29:01 +08:00
25 lines
604 B
JavaScript
25 lines
604 B
JavaScript
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();
|
|
});
|
|
});
|