Skip to content

Commit

Permalink
test play & pause buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
emillon committed Jan 25, 2015
1 parent 5842e52 commit 32dda7e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions static/coffee_spec/AudioPlayerSpec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ describe 'AudioPlayer', ->
audio =
duration: 100
addEventListener: ->
play: jasmine.createSpy 'audio play'
pause: jasmine.createSpy 'audio pause'

player.initAudio audio

Expand Down Expand Up @@ -95,6 +97,18 @@ describe 'AudioPlayer', ->
start: 4
length: 2

it 'has an play button', ->
$playBtn = player.$div.find('button:contains("Play")')
expect($playBtn).toHaveLength(1)
$playBtn.click()
expect(player.audio.play).toHaveBeenCalled()

it 'has an pause button', ->
$pauseBtn = player.$div.find('button:contains("Pause")')
expect($pauseBtn).toHaveLength(1)
$pauseBtn.click()
expect(player.audio.pause).toHaveBeenCalled()

describe 'waveform', ->
buffer = null
samples = null
Expand Down

0 comments on commit 32dda7e

Please sign in to comment.