2018-11-12 12:38:02 +08:00
|
|
|
import React from 'react';
|
2017-11-19 01:41:40 +08:00
|
|
|
import Switch from '..';
|
2018-11-12 12:38:02 +08:00
|
|
|
import { mount } from 'enzyme';
|
2017-11-19 01:41:40 +08:00
|
|
|
import focusTest from '../../../tests/shared/focusTest';
|
|
|
|
|
|
|
|
describe('Switch', () => {
|
|
|
|
focusTest(Switch);
|
2018-11-12 12:38:02 +08:00
|
|
|
|
|
|
|
it('should has click wave effect', async () => {
|
|
|
|
const wrapper = mount(<Switch />);
|
2018-12-07 20:02:01 +08:00
|
|
|
wrapper
|
|
|
|
.find('.ant-switch')
|
|
|
|
.getDOMNode()
|
|
|
|
.click();
|
2018-11-12 12:38:02 +08:00
|
|
|
await new Promise(resolve => setTimeout(resolve, 0));
|
|
|
|
expect(wrapper.render()).toMatchSnapshot();
|
|
|
|
});
|
2017-11-19 01:41:40 +08:00
|
|
|
});
|