From 637c9c2afde4d37351af0532ca450b6f230bfbac Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sun, 11 Feb 2018 11:50:08 -0500 Subject: [PATCH] Updating Message tests to use enzyme --- src/components/Message.test.js | 12 +++++------- src/components/__snapshots__/Message.test.js.snap | 5 ++--- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/components/Message.test.js b/src/components/Message.test.js index 256399d..cf06188 100644 --- a/src/components/Message.test.js +++ b/src/components/Message.test.js @@ -1,25 +1,23 @@ import React from 'react'; -import renderer from 'react-test-renderer'; +import { shallow, render } from 'enzyme'; import Message from './Message'; test('Message rendering', () => { - const component = renderer.create( + const component = shallow(

Message content

); - let tree = component.toJSON(); - expect(tree).toMatchSnapshot(); + expect(component).toMatchSnapshot(); }); test('Message rendering with icon', () => { const Icon = () => 'Sample icon SVG'; - const component = renderer.create( + const component = render(

Message content

); - let tree = component.toJSON(); - expect(tree).toMatchSnapshot(); + expect(component).toMatchSnapshot(); }); diff --git a/src/components/__snapshots__/Message.test.js.snap b/src/components/__snapshots__/Message.test.js.snap index aeeb785..67554e9 100644 --- a/src/components/__snapshots__/Message.test.js.snap +++ b/src/components/__snapshots__/Message.test.js.snap @@ -15,11 +15,10 @@ exports[`Message rendering 1`] = ` exports[`Message rendering with icon 1`] = `

- Sample icon SVG - Testing + Sample icon SVGTesting

Message content