From aaae57b7978ffd0038ad560d6c9a4e8cf064cb0d Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Thu, 19 Apr 2018 14:43:48 -0400 Subject: test test test --- frontend/__tests__/Cart.test.js | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'frontend/__tests__/Cart.test.js') diff --git a/frontend/__tests__/Cart.test.js b/frontend/__tests__/Cart.test.js index 2ee87a2..b62d0de 100644 --- a/frontend/__tests__/Cart.test.js +++ b/frontend/__tests__/Cart.test.js @@ -1,24 +1,16 @@ import React from 'react'; import { shallow, mount } from 'enzyme'; import toJSON from 'enzyme-to-json'; -import { Cart } from '../components/Cart'; -import { UIProvider } from '../components/UIContext'; - -const cartItem = { - item: { price: 5000 }, - quantity: 10, -}; - -const currentUser = { - me: { - cart: [cartItem, cartItem, cartItem], - }, - refetch() {}, -}; +import mountOptions from './mockMang'; +import wait from 'waait'; +import Cart from '../components/Cart'; describe('', () => { - it('renders', () => { - const wrapper = shallow(); - console.log(wrapper.first()); + it('renders', async () => { + const wrapper = mount(, mountOptions); + await wait(); + wrapper.update(); + expect(toJSON(wrapper.find('header'))).toMatchSnapshot(); + expect(wrapper.find('CartItem')).toHaveLength(2); }); }); -- cgit v1.3