summaryrefslogtreecommitdiffstats
path: root/frontend/__tests__/Cart.test.js
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-03-20 14:48:34 -0400
committerWes Bos <wesbos@gmail.com>2018-03-20 14:48:34 -0400
commit92f612a995c54f7423bd2b760fb1a324044693a6 (patch)
tree0350ceb82c0539bcafdded837c435ee68d6257ef /frontend/__tests__/Cart.test.js
parent217cfed064989816fbffcb1e285134c8e03ef5c7 (diff)
Starting testing
Diffstat (limited to 'frontend/__tests__/Cart.test.js')
-rw-r--r--frontend/__tests__/Cart.test.js15
1 files changed, 7 insertions, 8 deletions
diff --git a/frontend/__tests__/Cart.test.js b/frontend/__tests__/Cart.test.js
index 0936e97..1e7d7f5 100644
--- a/frontend/__tests__/Cart.test.js
+++ b/frontend/__tests__/Cart.test.js
@@ -2,6 +2,7 @@ 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 },
@@ -17,14 +18,12 @@ const currentUser = {
describe('<Cart/>', () => {
it('renders', () => {
- const wrapper = shallow(<Cart currentUser={currentUser} />);
- });
+ const wrapper = mount(
+ <UIProvider>
+ <Cart currentUser={currentUser} />
+ </UIProvider>
+ );
- xit('opens', () => {
- const wrapper = shallow(<Cart currentUser={currentUser} />);
- expect('wes').toEqual('figure out how to call test context');
+ expect(toJSON(wrapper)).toMatchSnapshot();
});
- // it('renders', () => {
- // shallow(<Cart currentUser={currentUserLoggedOut} />);
- // });
});