src/lib/components/PageGrid/atoms/Image/Image.test.js
import React from 'react';
import { mount } from 'enzyme';
import renderer from 'react-test-renderer';
import MuiImage from './Image';
function setup(href = null) {
const props = {
hrefLink: href,
image: 'www.applejuice.com',
};
const comp = mount(<MuiImage {...props} />);
return { comp, props };
}
describe('<MuiImage />', () => {
it('renders MuiImage', () => {
const { comp } = setup();
expect(comp).toBeDefined();
});
test('snapshot with MuiImage', () => {
const { props } = setup('/home');
const tree = renderer.create(<MuiImage {...props} />);
expect(tree).toMatchSnapshot();
});
});