Skip to content

Commit

Permalink
fix(index.test.js): change componentWillReceiveProps to componentDidU…
Browse files Browse the repository at this point in the history
…pdate in the tests
  • Loading branch information
Alberto Iglesias committed Jan 21, 2020
1 parent 769c323 commit 941c414
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ describe('Abcjs', () => {
it('mounts <Abcjs /> with a simple abcNotation', () => {
sinon.spy(Abcjs.prototype, 'render')
sinon.spy(Abcjs.prototype, 'componentDidMount')
sinon.spy(Abcjs.prototype, 'componentWillReceiveProps')
sinon.spy(Abcjs.prototype, 'componentDidUpdate')
const wrapper = mount(<Abcjs abcNotation={'X:1\nT:Test\nM:4/4\nK:G\nAggg'} />)
expect(Abcjs.prototype.render.calledOnce).to.equal(true)
expect(Abcjs.prototype.componentDidMount.calledOnce).to.equal(true)
wrapper.setProps({ renderParams: { viewportHorizontal: true } })
expect(Abcjs.prototype.componentWillReceiveProps.calledOnce).to.equal(true)
expect(Abcjs.prototype.componentDidUpdate.calledOnce).to.equal(true)
})
})

0 comments on commit 941c414

Please sign in to comment.