UNPKG

karmadata.ui

Version:
21 lines (16 loc) 686 B
import React from 'react'; import { shallow, mount, render } from 'enzyme'; import karmadataTheme from '../themes/karmadata.scss'; import ClearAll from '../components/ClearAll'; describe('ClearAll Test', () => { it ('should render without throwing an error', () => { const wrapper = shallow(<ClearAll theme={karmadataTheme} label="clearAll" />); expect(wrapper.contains('clearAll')).toBe(true); }); it ('should call onClick callback', () => { const onClick = jest.fn(); const wrapper = shallow(<ClearAll theme={karmadataTheme} label="clearAll" onClick={onClick}/>); wrapper.find('span').simulate('click'); expect(onClick).toHaveBeenCalled(); }); });