summaryrefslogtreecommitdiffstats
path: root/frontend/__tests__/Item.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/__tests__/Item.test.js')
-rw-r--r--frontend/__tests__/Item.test.js15
1 files changed, 3 insertions, 12 deletions
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('<Item/>', () => {
- it('Renders an item', () => {
- const removeItem = jest.fn();
- const wrapper = shallow(<ItemComponent item={fakeItem} removeItem={removeItem} />);
+ it('Renders and matches snapshot', () => {
+ const wrapper = shallow(<ItemComponent item={fakeItem} />);
expect(toJSON(wrapper)).toMatchSnapshot();
});
- it('handles button clicks', async () => {
- const removeItem = jest.fn();
- global.confirm = jest.fn().mockReturnValue(true);
- const wrapper = shallow(<ItemComponent item={fakeItem} removeItem={removeItem} />);
- wrapper.find('button').simulate('click');
- expect(removeItem).toHaveBeenCalled();
- expect(global.confirm).toHaveBeenCalled();
- });
});