Skip to content

Commit

Permalink
Add preload config tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpete committed Sep 11, 2017
1 parent 1531190 commit d368ae2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/karma/ReactPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,27 @@ describe('ReactPlayer', () => {
}
})
}

it('renders with preload config', done => {
const ref = p => {
if (!p) return
expect(p.wrapper).to.be.a('HTMLDivElement')
expect(p.wrapper.childNodes).to.have.length(3)
for (let div of p.wrapper.childNodes) {
expect(div.style.display).to.equal('none')
}
done()
}
render(
<ReactPlayer
ref={ref}
url={null}
config={{
youtube: { preload: true },
vimeo: { preload: true },
dailymotion: { preload: true }
}}
/>,
div)
})
})

0 comments on commit d368ae2

Please sign in to comment.