From 41331e7afc4676228142e47ff65c3619e73c5d82 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Thu, 19 Oct 2017 17:07:09 -0400 Subject: [PATCH] change to test `Button` click --- test/unit/components/button-click.test.jsx | 17 +++++++++++++ .../components/tool-select-click.test.jsx | 24 ------------------- 2 files changed, 17 insertions(+), 24 deletions(-) create mode 100644 test/unit/components/button-click.test.jsx delete mode 100644 test/unit/components/tool-select-click.test.jsx diff --git a/test/unit/components/button-click.test.jsx b/test/unit/components/button-click.test.jsx new file mode 100644 index 00000000..da26198b --- /dev/null +++ b/test/unit/components/button-click.test.jsx @@ -0,0 +1,17 @@ +/* eslint-env jest */ +import React from 'react'; // eslint-disable-line no-unused-vars +import {shallow} from 'enzyme'; +import Button from '../../../src/components/button/button.jsx'; // eslint-disable-line no-unused-vars, max-len + +describe('Button', () => { + test('triggers callback when clicked', () => { + const onClick = jest.fn(); + const componentShallowWrapper = shallow( + + ); + componentShallowWrapper.simulate('click'); + expect(onClick).toHaveBeenCalled(); + }); +}); diff --git a/test/unit/components/tool-select-click.test.jsx b/test/unit/components/tool-select-click.test.jsx deleted file mode 100644 index 196a3479..00000000 --- a/test/unit/components/tool-select-click.test.jsx +++ /dev/null @@ -1,24 +0,0 @@ -/* eslint-env jest */ -import React from 'react'; // eslint-disable-line no-unused-vars -import {shallow} from 'enzyme'; -import ToolSelectComponent from '../../../src/components/tool-select-base/tool-select-base.jsx'; // eslint-disable-line no-unused-vars, max-len - -describe('ToolSelectComponent', () => { - test('triggers callback when clicked', () => { - const onClick = jest.fn(); - const componentShallowWrapper = shallow( - - ); - componentShallowWrapper.simulate('click'); - expect(onClick).toHaveBeenCalled(); - }); -});