summaryrefslogtreecommitdiffstats
path: root/frontend/__tests__/AddToCart.test.js
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-04-19 10:09:51 -0400
committerWes Bos <wesbos@gmail.com>2018-04-19 10:09:51 -0400
commit88ef4bd2df970cb6ea89123ffdd7fcb21dbc0f15 (patch)
tree619a1f46b719e1f6a0c64e9641ed094dcddfebff /frontend/__tests__/AddToCart.test.js
parent54dd0e29830f04c9055863fb0449ee4fc2ab0689 (diff)
xxxxxx
Diffstat (limited to 'frontend/__tests__/AddToCart.test.js')
-rw-r--r--frontend/__tests__/AddToCart.test.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/frontend/__tests__/AddToCart.test.js b/frontend/__tests__/AddToCart.test.js
index 2285b3b..f049152 100644
--- a/frontend/__tests__/AddToCart.test.js
+++ b/frontend/__tests__/AddToCart.test.js
@@ -10,13 +10,17 @@ const currentUser = {
describe('<AddtoCart/>', () => {
it('renders and matches snapshot', () => {
- const wrapper = shallow(<AddToCart id="abc123" addToCart={() => {}} currentUser={currentUser} />);
+ const wrapper = shallow(
+ <AddToCart id="abc123" addToCart={() => {}} currentUser={currentUser} />
+ );
expect(toJSON(wrapper)).toMatchSnapshot();
});
it('adds an item to the cart', () => {
const addToCart = jest.fn(() => Promise.resolve());
- const wrapper = shallow(<AddToCart id="abc123" addToCart={addToCart} currentUser={currentUser} />);
+ const wrapper = shallow(
+ <AddToCart id="abc123" addToCart={addToCart} currentUser={currentUser} />
+ );
wrapper.simulate('click');
expect(addToCart).toHaveBeenCalled();
expect(addToCart).toHaveBeenCalledWith({ variables: { id: 'abc123' } });