diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-06-14 16:44:21 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-06-14 16:44:21 -0400 |
| commit | b1600adec47a04f60e1da07d94a3ed3906ff5aee (patch) | |
| tree | 828f786da6806d7237ee5cbc5df61e552353b85b /frontend/__tests__/Cart.test.js | |
| parent | a95e08cd2dd5d7ec0a0412adae02515a5f9cec4f (diff) | |
starter files
Diffstat (limited to 'frontend/__tests__/Cart.test.js')
| -rw-r--r-- | frontend/__tests__/Cart.test.js | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/frontend/__tests__/Cart.test.js b/frontend/__tests__/Cart.test.js deleted file mode 100644 index 255183e..0000000 --- a/frontend/__tests__/Cart.test.js +++ /dev/null @@ -1,46 +0,0 @@ -import React from 'react'; -import { shallow, mount } from 'enzyme'; -import toJSON from 'enzyme-to-json'; -import mountOptions from '../lib/testUtils'; -import wait from 'waait'; -import Cart from '../components/Cart'; -import { MockedProvider } from 'react-apollo/test-utils'; -import { fakeCartItem, fakeUser } from '../lib/testUtils'; -import { CURRENT_USER_QUERY } from '../components/User'; -import { LOCAL_STATE_QUERY } from '../components/Cart'; - -const mocks = [ - { - request: { query: CURRENT_USER_QUERY }, - result: { - data: { - me: { - ...fakeUser(), - cart: [fakeCartItem()], - }, - }, - }, - }, - { - request: { query: LOCAL_STATE_QUERY }, - result: { - data: { - cartOpen: true, - }, - }, - }, -]; - -describe('<Cart/>', () => { - it('renders', async () => { - const wrapper = mount( - <MockedProvider mocks={mocks}> - <Cart /> - </MockedProvider> - ); - await wait(); - wrapper.update(); - expect(toJSON(wrapper.find('header'))).toMatchSnapshot(); - expect(wrapper.find('CartItem')).toHaveLength(1); - }); -}); |
