Fixed a couple errors in the tests.
This commit is contained in:
parent
091910f2ad
commit
ba79d59190
2 changed files with 5 additions and 2 deletions
|
@ -152,6 +152,7 @@ module.exports = class GoalManager extends CocoClass
|
||||||
|
|
||||||
checkForInitialUserCodeProblems: ->
|
checkForInitialUserCodeProblems: ->
|
||||||
# There might have been some user code problems reported before the goal manager started listening.
|
# There might have been some user code problems reported before the goal manager started listening.
|
||||||
|
return unless @world
|
||||||
for thang in @world.thangs when thang.isProgrammable
|
for thang in @world.thangs when thang.isProgrammable
|
||||||
for message, problem of thang.publishedUserCodeProblems
|
for message, problem of thang.publishedUserCodeProblems
|
||||||
@onUserCodeProblem {thang: thang, problem: problem}, 0
|
@onUserCodeProblem {thang: thang, problem: problem}, 0
|
||||||
|
|
|
@ -136,12 +136,14 @@ describe 'SegmentedSprite', ->
|
||||||
segmentedSprite.tick(500)
|
segmentedSprite.tick(500)
|
||||||
expect(segmentedSprite.baseMovieClip.currentFrame).toBe(6)
|
expect(segmentedSprite.baseMovieClip.currentFrame).toBe(6)
|
||||||
|
|
||||||
it 'emits animationend for animations where loops is false and there is no goesTo', ->
|
it 'emits animationend for animations where loops is false and there is no goesTo', (done) ->
|
||||||
fired = false
|
fired = false
|
||||||
segmentedSprite.gotoAndPlay('onestep')
|
segmentedSprite.gotoAndPlay('onestep')
|
||||||
segmentedSprite.on('animationend', -> fired = true)
|
segmentedSprite.on('animationend', -> fired = true)
|
||||||
segmentedSprite.tick(1000)
|
segmentedSprite.tick(1000)
|
||||||
expect(fired).toBe(true)
|
_.defer -> # because the event is deferred
|
||||||
|
expect(fired).toBe(true)
|
||||||
|
done()
|
||||||
|
|
||||||
it 'scales rendered animations like a MovieClip', ->
|
it 'scales rendered animations like a MovieClip', ->
|
||||||
# build a movie clip, put it on top of the segmented sprite and make sure
|
# build a movie clip, put it on top of the segmented sprite and make sure
|
||||||
|
|
Reference in a new issue