mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-29 03:48:26 +08:00
9678d3fcfd
* Add test for select * Add focus() and blur() for AutoComplete * Add focus() and blur() to Cascader * Add focus test for input * Add focus() and blur() for Checkbox * Add focus() and blur() for Radio * Add focus() and blur() for Switch * Add blur() for TimePicker * Add focus() and blur() to TreeSelect
27 lines
618 B
JavaScript
27 lines
618 B
JavaScript
import React from 'react';
|
|
import { shallow } from 'enzyme';
|
|
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 = shallow(
|
|
<Checkbox
|
|
onMouseEnter={onMouseEnter}
|
|
onMouseLeave={onMouseLeave}
|
|
/>
|
|
);
|
|
|
|
wrapper.simulate('mouseenter');
|
|
expect(onMouseEnter).toHaveBeenCalled();
|
|
|
|
wrapper.simulate('mouseleave');
|
|
expect(onMouseLeave).toHaveBeenCalled();
|
|
});
|
|
});
|