import React from 'react'; import { shallow } from 'enzyme'; import { common } from '../../util/generic-tests'; import Selection from './Selection'; describe('Selection', () => { common(Selection); describe('render', () => { it('should match snapshot for responsiveMode small', () => { const wrapper = shallow( Yolo ); expect(wrapper).toMatchSnapshot(); }); it('should match snapshot for container', () => { expect( shallow(cont) ).toMatchSnapshot(); }); it('should match snapshot for success', () => { expect( shallow(cont) ).toMatchSnapshot(); }); it('should match snapshot for danger', () => { expect( shallow(cont) ).toMatchSnapshot(); }); it('should match snapshot for info', () => { expect( shallow(cont) ).toMatchSnapshot(); }); it('should match snapshot for warning', () => { expect( shallow(cont) ).toMatchSnapshot(); }); it('should match snapshot for non removable', () => { expect(shallow()).toMatchSnapshot(); }); it('should match snapshot for nested selections', () => { const wrapper = shallow( Hello There ); expect(wrapper).toMatchSnapshot(); }); it('should match snapshot for custom icons', () => { const wrapper = shallow(
); expect(wrapper).toMatchSnapshot(); }); }); describe('props', () => { it('onRemove', () => { const onRemove = jest.fn(); const wrapper: any = shallow(); wrapper.find('CloseIcon').prop('onClick')({}); expect(onRemove).toHaveBeenCalled(); }); }); });