diff --git a/src/components/Switch/__tests__/__snapshots__/index-test.js.snap b/src/components/Switch/__tests__/__snapshots__/index-test.js.snap deleted file mode 100644 index 91a3e45e..00000000 --- a/src/components/Switch/__tests__/__snapshots__/index-test.js.snap +++ /dev/null @@ -1,84 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`components/Switch disabled when "false" a default checkbox is rendered 1`] = ` -
-
-
- -
-`; - -exports[`components/Switch disabled when "true" a disabled checkbox is rendered 1`] = ` -
-
-
- -
-`; - -exports[`components/Switch value when "false" an unchecked checkbox is rendered 1`] = ` -
-
-
- -
-`; - -exports[`components/Switch value when "true" a checked checkbox is rendered 1`] = ` -
-
-
- -
-`; diff --git a/src/components/Switch/__tests__/index-test.js b/src/components/Switch/__tests__/index-test.js index 59bbed05..1a30f054 100644 --- a/src/components/Switch/__tests__/index-test.js +++ b/src/components/Switch/__tests__/index-test.js @@ -1,19 +1,21 @@ /* eslint-env jasmine, jest */ import React from 'react'; -import { render } from 'enzyme'; +import { shallow } from 'enzyme'; import Switch from '..'; +const checkboxSelector = 'input[type="checkbox"]'; + describe('components/Switch', () => { describe('disabled', () => { test('when "false" a default checkbox is rendered', () => { - const component = render(); - expect(component).toMatchSnapshot(); + const component = shallow(); + expect(component.find(checkboxSelector).prop('disabled')).toBe(false); }); test('when "true" a disabled checkbox is rendered', () => { - const component = render(); - expect(component).toMatchSnapshot(); + const component = shallow(); + expect(component.find(checkboxSelector).prop('disabled')).toBe(true); }); }); @@ -35,13 +37,13 @@ describe('components/Switch', () => { describe('value', () => { test('when "false" an unchecked checkbox is rendered', () => { - const component = render(); - expect(component).toMatchSnapshot(); + const component = shallow(); + expect(component.find(checkboxSelector).prop('checked')).toBe(false); }); test('when "true" a checked checkbox is rendered', () => { - const component = render(); - expect(component).toMatchSnapshot(); + const component = shallow(); + expect(component.find(checkboxSelector).prop('checked')).toBe(true); }); }); });