Skip to content

Commit

Permalink
Fixed code styles
Browse files Browse the repository at this point in the history
  • Loading branch information
sproogen committed Aug 14, 2017
1 parent f3a00ea commit 9a2bc92
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/Resources/client/tests/components/Button.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ describe('(Component) Button', () => {
})

it('Should have props', () => {
const wrapper = mount(<Button text='Click Me!' className='button' disabled={true} callback={()=>{}} submitEvent='onSubmit' />)
const wrapper = mount(
<Button text='Click Me!' className='button' disabled callback={() => {}} submitEvent='onSubmit' />
)
expect(wrapper.props().text).to.equal('Click Me!')
expect(wrapper.props().className).to.equal('button')
expect(wrapper.props().disabled).to.equal(true)
Expand All @@ -43,7 +45,7 @@ describe('(Component) Button', () => {
})

it('Should return true for prop', () => {
const wrapper = shallow(<Button disabled={true} />).instance()
const wrapper = shallow(<Button disabled />).instance()
expect(wrapper.isDisabled()).to.equal(true)
})

Expand All @@ -56,7 +58,7 @@ describe('(Component) Button', () => {

describe('(Method) handlePress', () => {
it('Should update the state', () => {
const wrapper = shallow(<Button callback={ () => {return Promise.resolve()}} />)
const wrapper = shallow(<Button callback={() => Promise.resolve()} />)
const instance = wrapper.instance()
instance.handlePress()
expect(wrapper.state()).to.deep.equal({ disabled : true, loading : true })
Expand All @@ -71,7 +73,7 @@ describe('(Component) Button', () => {
})

it('Shouldn\'t update the state when disabled', () => {
const wrapper = shallow(<Button disabled={true} callback={ () => {return Promise.resolve()}} />)
const wrapper = shallow(<Button disabled callback={() => Promise.resolve()} />)
const instance = wrapper.instance()
instance.handlePress()
expect(wrapper.state()).to.deep.equal({ disabled : false, loading : false })
Expand Down Expand Up @@ -103,13 +105,13 @@ describe('(Component) Button', () => {
})

it('Should be disabled', () => {
const wrapper = shallow(<Button text='Click Me!' disabled={true} />)
const wrapper = shallow(<Button text='Click Me!' disabled />)
expect(wrapper.props().disabled).to.equal(true)
expect(wrapper.props().className).to.equal('btn disabled')
})

it('Should have className', () => {
const wrapper = shallow(<Button className='button button--class' disabled={true} />)
const wrapper = shallow(<Button className='button button--class' disabled />)
expect(wrapper.props().className).to.equal('btn button button--class disabled')
})

Expand Down

0 comments on commit 9a2bc92

Please sign in to comment.