blob: b62d0dede6182f2105ff84143473ccba987616dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import React from 'react';
import { shallow, mount } from 'enzyme';
import toJSON from 'enzyme-to-json';
import mountOptions from './mockMang';
import wait from 'waait';
import Cart from '../components/Cart';
describe('<Cart/>', () => {
it('renders', async () => {
const wrapper = mount(<Cart />, mountOptions);
await wait();
wrapper.update();
expect(toJSON(wrapper.find('header'))).toMatchSnapshot();
expect(wrapper.find('CartItem')).toHaveLength(2);
});
});
|