From 093c172d16732ba8d01faa313e0af99d26902205 Mon Sep 17 00:00:00 2001 From: Wes Bos Date: Fri, 7 Sep 2018 12:15:53 -0400 Subject: getting there --- .../59/frontend/__tests__/CartCount.test.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 stepped-solutions/59/frontend/__tests__/CartCount.test.js (limited to 'stepped-solutions/59/frontend/__tests__/CartCount.test.js') diff --git a/stepped-solutions/59/frontend/__tests__/CartCount.test.js b/stepped-solutions/59/frontend/__tests__/CartCount.test.js new file mode 100755 index 0000000..8ace3da --- /dev/null +++ b/stepped-solutions/59/frontend/__tests__/CartCount.test.js @@ -0,0 +1,21 @@ +import { shallow, mount } from 'enzyme'; +import toJSON from 'enzyme-to-json'; +import CartCount from '../components/CartCount'; + +describe('', () => { + it('renders', () => { + shallow(); + }); + + it('matches the snapshot', () => { + const wrapper = shallow(); + expect(toJSON(wrapper)).toMatchSnapshot(); + }); + + it('updates via props', () => { + const wrapper = shallow(); + expect(toJSON(wrapper)).toMatchSnapshot(); + wrapper.setProps({ count: 10 }); + expect(toJSON(wrapper)).toMatchSnapshot(); + }); +}); -- cgit v1.3