Skip to content

Commit

Permalink
YouTube player testcase fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
me-andre committed Apr 4, 2019
1 parent 31462e5 commit 9ab8d02
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/players/YouTube.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,13 @@ test('load() when ready', t => {
getSDK.restore()
})

test('onStateChange() - play', async t => {
const onPlay = () => t.pass()
const instance = shallow(<YouTube url={TEST_URL} onPlay={onPlay} />).instance()
test('onStateChange() - play', t => {
const called = {};
const onPlay = () => { called.onPlay = true }
const onBufferEnd = () => { called.onBufferEnd = true }
const instance = shallow(<YouTube url={TEST_URL} onPlay={onPlay} onBufferEnd={onBufferEnd} />).instance()
instance.onStateChange({ data: 'PLAYING' })
t.true(called.onPlay && called.onBufferEnd);
})

test('onStateChange() - pause', async t => {
Expand Down

0 comments on commit 9ab8d02

Please sign in to comment.