From 8a3c49befc2c3d2b68ed11c5f2e217cb177caf57 Mon Sep 17 00:00:00 2001 From: Boxuan Li Date: Sat, 28 Jul 2018 22:01:24 +0800 Subject: [PATCH] reactions.jsx: Add snapshot test Related to https://github.com/coala/gh-board/issues/129 --- .../__snapshots__/reactions.test.js.snap | 54 +++++++++++++++++++ test/src/components/reactions.test.js | 17 ++++++ 2 files changed, 71 insertions(+) create mode 100644 test/src/components/__snapshots__/reactions.test.js.snap create mode 100644 test/src/components/reactions.test.js diff --git a/test/src/components/__snapshots__/reactions.test.js.snap b/test/src/components/__snapshots__/reactions.test.js.snap new file mode 100644 index 00000000..16394d03 --- /dev/null +++ b/test/src/components/__snapshots__/reactions.test.js.snap @@ -0,0 +1,54 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`does not display number zero 1`] = ` +Array [ + , + , + , + , + , + , +] +`; diff --git a/test/src/components/reactions.test.js b/test/src/components/reactions.test.js new file mode 100644 index 00000000..553e35cb --- /dev/null +++ b/test/src/components/reactions.test.js @@ -0,0 +1,17 @@ +import renderer from 'react-test-renderer'; +import Reactions from '../../../src/components/reactions'; + +it('does not display number zero', () => { + const stat = { + THUMBS_UP: 0, + THUMBS_DOWN: 0, + LAUGH: 0, + HOORAY: 0, + CONFUSED: 0, + HEART: 0, + }; + const rendered = renderer.create( + + ); + expect(rendered.toJSON()).toMatchSnapshot(); +});