ant-design/components/switch/__tests__/index.test.js

19 lines
472 B
JavaScript
Raw Normal View History

import React from 'react';
import Switch from '..';
import { mount } from 'enzyme';
import focusTest from '../../../tests/shared/focusTest';
describe('Switch', () => {
focusTest(Switch);
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();
await new Promise(resolve => setTimeout(resolve, 0));
expect(wrapper.render()).toMatchSnapshot();
});
});