From c80bb5d1681635ace3eb9764bb4dc737f3ededf2 Mon Sep 17 00:00:00 2001 From: James Grant Date: Tue, 15 Aug 2017 00:43:06 +0100 Subject: [PATCH] Revert "F/#105 button tests" --- .../client/src/components/Button/Button.js | 10 +- .../client/tests/components/Button.spec.js | 124 ------------------ 2 files changed, 4 insertions(+), 130 deletions(-) delete mode 100644 app/Resources/client/tests/components/Button.spec.js diff --git a/app/Resources/client/src/components/Button/Button.js b/app/Resources/client/src/components/Button/Button.js index 96cbaf5e..49e49068 100644 --- a/app/Resources/client/src/components/Button/Button.js +++ b/app/Resources/client/src/components/Button/Button.js @@ -36,7 +36,7 @@ class Button extends React.Component { if (event) { event.preventDefault() } - if (!this.isDisabled() && this.props.callback) { + if (!this.isDisabled()) { this.setState({ disabled : true, loading : true @@ -64,17 +64,15 @@ class Button extends React.Component { } Button.propTypes = { - text : PropTypes.string, + text : PropTypes.string.isRequired, className : PropTypes.string, disabled : PropTypes.bool, - callback : PropTypes.func, + callback : PropTypes.func.isRequired, submitEvent : PropTypes.string } Button.defaultProps = { - text : '', - className : '', - disabled : false, + disabled : false, } export default Button diff --git a/app/Resources/client/tests/components/Button.spec.js b/app/Resources/client/tests/components/Button.spec.js deleted file mode 100644 index e6ab8942..00000000 --- a/app/Resources/client/tests/components/Button.spec.js +++ /dev/null @@ -1,124 +0,0 @@ -import React from 'react' -import Button from 'components/Button/Button' -import { shallow, mount } from 'enzyme' -import EventBus from 'components/EventBus' - -describe('(Component) Button', () => { - it('renders as a button', () => { - const wrapper = shallow(