From b1ca3f29d5a5d0c7bbc23e48254ed0cd535eea81 Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Thu, 19 Oct 2017 16:37:39 -0400 Subject: [PATCH] Rename paint-editor to new folder too and update click tests to just look at the base component --- .../{ => paint-editor}/paint-editor.css | 0 .../{ => paint-editor}/paint-editor.jsx | 32 +++++++++---------- test/unit/components/brush-mode.test.jsx | 15 --------- test/unit/components/eraser-mode.test.jsx | 15 --------- test/unit/components/line-mode.test.jsx | 15 --------- test/unit/components/reshape-mode.test.jsx | 15 --------- test/unit/components/select-mode.test.jsx | 15 --------- .../components/tool-select-click.test.jsx | 24 ++++++++++++++ 8 files changed, 40 insertions(+), 91 deletions(-) rename src/components/{ => paint-editor}/paint-editor.css (100%) rename src/components/{ => paint-editor}/paint-editor.jsx (86%) delete mode 100644 test/unit/components/brush-mode.test.jsx delete mode 100644 test/unit/components/eraser-mode.test.jsx delete mode 100644 test/unit/components/line-mode.test.jsx delete mode 100644 test/unit/components/reshape-mode.test.jsx delete mode 100644 test/unit/components/select-mode.test.jsx create mode 100644 test/unit/components/tool-select-click.test.jsx diff --git a/src/components/paint-editor.css b/src/components/paint-editor/paint-editor.css similarity index 100% rename from src/components/paint-editor.css rename to src/components/paint-editor/paint-editor.css diff --git a/src/components/paint-editor.jsx b/src/components/paint-editor/paint-editor.jsx similarity index 86% rename from src/components/paint-editor.jsx rename to src/components/paint-editor/paint-editor.jsx index be530590..651253d0 100644 --- a/src/components/paint-editor.jsx +++ b/src/components/paint-editor/paint-editor.jsx @@ -2,26 +2,26 @@ import bindAll from 'lodash.bindall'; import React from 'react'; import PropTypes from 'prop-types'; -import PaperCanvas from '../containers/paper-canvas.jsx'; +import PaperCanvas from '../../containers/paper-canvas.jsx'; -import BrushMode from '../containers/brush-mode.jsx'; -import EraserMode from '../containers/eraser-mode.jsx'; -import ReshapeMode from '../containers/reshape-mode.jsx'; -import SelectMode from '../containers/select-mode.jsx'; -import LineMode from '../containers/line-mode.jsx'; -import PenMode from '../containers/pen-mode.jsx'; -import RectMode from '../containers/rect-mode.jsx'; -import RoundedRectMode from '../containers/rounded-rect-mode.jsx'; -import OvalMode from '../containers/oval-mode.jsx'; +import BrushMode from '../../containers/brush-mode.jsx'; +import EraserMode from '../../containers/eraser-mode.jsx'; +import ReshapeMode from '../../containers/reshape-mode.jsx'; +import SelectMode from '../../containers/select-mode.jsx'; +import LineMode from '../../containers/line-mode.jsx'; +import PenMode from '../../containers/pen-mode.jsx'; +import RectMode from '../../containers/rect-mode.jsx'; +import RoundedRectMode from '../../containers/rounded-rect-mode.jsx'; +import OvalMode from '../../containers/oval-mode.jsx'; -import FillColorIndicatorComponent from '../containers/fill-color-indicator.jsx'; -import StrokeColorIndicatorComponent from '../containers/stroke-color-indicator.jsx'; -import StrokeWidthIndicatorComponent from '../containers/stroke-width-indicator.jsx'; +import FillColorIndicatorComponent from '../../containers/fill-color-indicator.jsx'; +import StrokeColorIndicatorComponent from '../../containers/stroke-color-indicator.jsx'; +import StrokeWidthIndicatorComponent from '../../containers/stroke-width-indicator.jsx'; import {defineMessages, injectIntl, intlShape} from 'react-intl'; -import BufferedInputHOC from './forms/buffered-input-hoc.jsx'; -import Label from './forms/label.jsx'; -import Input from './forms/input.jsx'; +import BufferedInputHOC from '../forms/buffered-input-hoc.jsx'; +import Label from '../forms/label.jsx'; +import Input from '../forms/input.jsx'; import styles from './paint-editor.css'; diff --git a/test/unit/components/brush-mode.test.jsx b/test/unit/components/brush-mode.test.jsx deleted file mode 100644 index 954ef837..00000000 --- a/test/unit/components/brush-mode.test.jsx +++ /dev/null @@ -1,15 +0,0 @@ -/* eslint-env jest */ -import React from 'react'; // eslint-disable-line no-unused-vars -import {shallow} from 'enzyme'; -import BrushModeComponent from '../../../src/components/brush-mode.jsx'; // eslint-disable-line no-unused-vars - -describe('BrushModeComponent', () => { - test('triggers callback when clicked', () => { - const onClick = jest.fn(); - const componentShallowWrapper = shallow( - - ); - componentShallowWrapper.simulate('click'); - expect(onClick).toHaveBeenCalled(); - }); -}); diff --git a/test/unit/components/eraser-mode.test.jsx b/test/unit/components/eraser-mode.test.jsx deleted file mode 100644 index 4772581c..00000000 --- a/test/unit/components/eraser-mode.test.jsx +++ /dev/null @@ -1,15 +0,0 @@ -/* eslint-env jest */ -import React from 'react'; // eslint-disable-line no-unused-vars -import {shallow} from 'enzyme'; -import EraserModeComponent from '../../../src/components/eraser-mode.jsx'; // eslint-disable-line no-unused-vars - -describe('EraserModeComponent', () => { - test('triggers callback when clicked', () => { - const onClick = jest.fn(); - const componentShallowWrapper = shallow( - - ); - componentShallowWrapper.simulate('click'); - expect(onClick).toHaveBeenCalled(); - }); -}); diff --git a/test/unit/components/line-mode.test.jsx b/test/unit/components/line-mode.test.jsx deleted file mode 100644 index 7be2ff14..00000000 --- a/test/unit/components/line-mode.test.jsx +++ /dev/null @@ -1,15 +0,0 @@ -/* eslint-env jest */ -import React from 'react'; // eslint-disable-line no-unused-vars -import {shallow} from 'enzyme'; -import LineModeComponent from '../../../src/components/line-mode.jsx'; // eslint-disable-line no-unused-vars - -describe('LineModeComponent', () => { - test('triggers callback when clicked', () => { - const onClick = jest.fn(); - const componentShallowWrapper = shallow( - - ); - componentShallowWrapper.simulate('click'); - expect(onClick).toHaveBeenCalled(); - }); -}); diff --git a/test/unit/components/reshape-mode.test.jsx b/test/unit/components/reshape-mode.test.jsx deleted file mode 100644 index a6c71a3a..00000000 --- a/test/unit/components/reshape-mode.test.jsx +++ /dev/null @@ -1,15 +0,0 @@ -/* eslint-env jest */ -import React from 'react'; // eslint-disable-line no-unused-vars -import {shallow} from 'enzyme'; -import ReshapeModeComponent from '../../../src/components/reshape-mode.jsx'; // eslint-disable-line no-unused-vars - -describe('ReshapeModeComponent', () => { - test('triggers callback when clicked', () => { - const onClick = jest.fn(); - const componentShallowWrapper = shallow( - - ); - componentShallowWrapper.simulate('click'); - expect(onClick).toHaveBeenCalled(); - }); -}); diff --git a/test/unit/components/select-mode.test.jsx b/test/unit/components/select-mode.test.jsx deleted file mode 100644 index 3ec1ba29..00000000 --- a/test/unit/components/select-mode.test.jsx +++ /dev/null @@ -1,15 +0,0 @@ -/* eslint-env jest */ -import React from 'react'; // eslint-disable-line no-unused-vars -import {shallow} from 'enzyme'; -import SelectModeComponent from '../../../src/components/select-mode.jsx'; // eslint-disable-line no-unused-vars - -describe('SelectModeComponent', () => { - 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 new file mode 100644 index 00000000..196a3479 --- /dev/null +++ b/test/unit/components/tool-select-click.test.jsx @@ -0,0 +1,24 @@ +/* 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(); + }); +});