diff --git a/lib/components/checkbox/__snapshots__/test.js.snap b/lib/components/checkbox/__snapshots__/test.js.snap index 318294abc..53e6c6c10 100644 --- a/lib/components/checkbox/__snapshots__/test.js.snap +++ b/lib/components/checkbox/__snapshots__/test.js.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`renders Checkbox correctly when checked 1`] = ` +exports[`hasn't had its output unintentionally altered 1`] = ` `; - -exports[`renders Checkbox correctly when not checked 1`] = ` - - - -`; diff --git a/lib/components/checkbox/test.js b/lib/components/checkbox/test.js index b8b428c5d..48e0e4456 100644 --- a/lib/components/checkbox/test.js +++ b/lib/components/checkbox/test.js @@ -1,15 +1,25 @@ -import React from 'react'; import Checkbox from './'; +import CheckmarkIcon from '../../icons/checkmark'; +import CircleIcon from '../../icons/circle'; +import React from 'react'; import renderer from 'react-test-renderer'; +import { shallow } from 'enzyme'; -it('renders Checkbox correctly when checked', () => { +it("hasn't had its output unintentionally altered", () => { const tree = renderer.create().toJSON(); expect(tree).toMatchSnapshot(); }); -it('renders Checkbox correctly when not checked', () => { - const tree = renderer.create().toJSON(); - expect(tree).toMatchSnapshot(); +it('renders the circle icon when unchecked', () => { + const checkbox = shallow(); + expect(checkbox.find(CircleIcon)).toHaveLength(1); + expect(checkbox.find(CheckmarkIcon)).toHaveLength(0); +}); + +it('renders the checkmark icon when checked', () => { + const checkbox = shallow(); + expect(checkbox.find(CircleIcon)).toHaveLength(0); + expect(checkbox.find(CheckmarkIcon)).toHaveLength(1); }); it('should call onChange prop when span is clicked', () => {