@ima/devtools
Version:
IMA.js debugging panel in the Chrome Developer Tools window.
29 lines (23 loc) • 659 B
JSX
import { shallow } from 'enzyme';
import Alerts from '../Alerts';
describe('Alerts molecule', () => {
const props = {
alerts: {
0: {
id: '0',
hidden: false,
title: 'title',
content: 'content',
type: 'default',
},
},
removeAlert: jest.fn(),
};
let wrapper = shallow(<Alerts {...props} />);
let instance = wrapper.instance();
it('should call props.removeAlert when clicking on alert', () => {
wrapper.find('Alert').simulate('click');
expect(instance.props.removeAlert.mock.calls).toHaveLength(1);
expect(instance.props.removeAlert.mock.calls[0][0]).toBe('0');
});
});