created tests for components related to importing from source
This commit is contained in:
16
web/src/components/helper/__tests__/Modal.test.js
Normal file
16
web/src/components/helper/__tests__/Modal.test.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import React from 'react';
|
||||
import { shallow, mount } from 'enzyme';
|
||||
import Modal from '../Modal';
|
||||
|
||||
it('renders without crashing', () => {
|
||||
shallow(<Modal />);
|
||||
});
|
||||
|
||||
it('receives props as expected', () =>{
|
||||
const actionButton = <button key={0}>Dummy action button</button>;
|
||||
const childButton = <button key={1}>Child button</button>;
|
||||
const wrapper = mount(<Modal title={'Dummy title'} actions={[actionButton]}>{childButton}</Modal>);
|
||||
expect(wrapper.props().title).toEqual('Dummy title');
|
||||
expect(wrapper.props().actions).toEqual([actionButton]);
|
||||
expect(wrapper.props().children).toEqual(childButton);
|
||||
});
|
||||
Reference in New Issue
Block a user