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()
- const inst = wrapper.instance()
- expect(inst).to.be.instanceOf(Button)
- expect(wrapper.name()).to.equal('button')
- })
-
- describe('(State)', () => {
- it('Should have initial state', () => {
- const wrapper = mount()
- expect(wrapper.state()).to.deep.equal({ disabled : false, loading : false })
- })
- })
-
- describe('(Props)', () => {
- it('Should have default props', () => {
- const wrapper = mount()
- expect(wrapper.props().text).to.equal('')
- expect(wrapper.props().className).to.equal('')
- expect(wrapper.props().disabled).to.equal(false)
- })
-
- it('Should have props', () => {
- const wrapper = mount(
-