From f02a5dc73ac4a14c1d641a6ddbfcd2f1bd2ea0b5 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Wed, 2 May 2018 14:45:20 -0400 Subject: TESTS --- frontend/__tests__/Item.test.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'frontend/__tests__/Item.test.js') diff --git a/frontend/__tests__/Item.test.js b/frontend/__tests__/Item.test.js index 2990b1f..129efa9 100644 --- a/frontend/__tests__/Item.test.js +++ b/frontend/__tests__/Item.test.js @@ -3,7 +3,7 @@ import React from 'react'; import Enzyme, { shallow, mount } from 'enzyme'; import toJSON from 'enzyme-to-json'; -import { ItemComponent } from '../components/Item'; +import ItemComponent from '../components/Item'; const fakeItem = { id: 'ABC123', @@ -15,17 +15,8 @@ const fakeItem = { }; describe('', () => { - it('Renders an item', () => { - const removeItem = jest.fn(); - const wrapper = shallow(); + it('Renders and matches snapshot', () => { + const wrapper = shallow(); expect(toJSON(wrapper)).toMatchSnapshot(); }); - it('handles button clicks', async () => { - const removeItem = jest.fn(); - global.confirm = jest.fn().mockReturnValue(true); - const wrapper = shallow(); - wrapper.find('button').simulate('click'); - expect(removeItem).toHaveBeenCalled(); - expect(global.confirm).toHaveBeenCalled(); - }); }); -- cgit v1.3