Skip to content

Commit

Permalink
chore (layers) fix layer tests to account for delay on iOS events del…
Browse files Browse the repository at this point in the history
…ivery
  • Loading branch information
pentateu committed Jun 16, 2015
1 parent 17ec416 commit bec3c44
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
4 changes: 4 additions & 0 deletions testApp/app/views/modal/hide.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
hide({disableAnimation: true})
</a>

<a class="performsTest item item-text-wrap" data-location="testHideAll">
Hide All
</a>

<a class="performsTest item item-text-wrap" data-location="testOpenAnotherModal">
Open Another Modal
</a>
Expand Down
19 changes: 12 additions & 7 deletions testSpecApp/app/specs/layers.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ describe "Layers", ->


describe "willchange & didchange events", ->
it "should log 2 'willchange' events when pushing & popping a layer", (done)->

@timeout 2500

it "should log 2 'willchange' events when pushing & popping a layer", (done)->
eventsCount = 0

steroids.layers.on "willchange", ->
Expand All @@ -47,11 +49,13 @@ describe "Layers", ->
setTimeout ->
steroids.layers.pop {},
onSuccess: ->
eventsCount.should.equal 2
done()
setTimeout ->
eventsCount.should.equal 2
done()
, 500
onFailure: (error) ->
done new Error "could not pop view: " + error.errorDescription
, 600
, 1000
onFailure: (error) ->
done new Error "could not push view: " + error.errorDescription
}
Expand All @@ -73,12 +77,13 @@ describe "Layers", ->
setTimeout ->
steroids.layers.pop {},
onSuccess: ->
eventsCount.should.equal 2
done()
setTimeout ->
eventsCount.should.equal 2
done()
, 750
onFailure: (error) ->
done new Error "could not pop view: " + error.errorDescription
, 600
onFailure: (error) ->
done new Error "could not push view: " + error.errorDescription
}

0 comments on commit bec3c44

Please sign in to comment.