fixes range test
This commit is contained in:
parent
e46de301f5
commit
3a10865f09
@ -4,13 +4,13 @@ require('phantomjs-polyfill');
|
|||||||
|
|
||||||
test('time moves', function(assert) {
|
test('time moves', function(assert) {
|
||||||
var done = assert.async();
|
var done = assert.async();
|
||||||
var animator = new torque.Animator(function(){}, {steps: 500, animationDuration: 2});
|
var animatora = new torque.Animator(function(){}, {steps: 500, animationDuration: 2});
|
||||||
animator.start();
|
animatora.start();
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
assert.notEqual(animator._time, 0);
|
assert.notEqual(animatora._time, 0);
|
||||||
done();
|
done();
|
||||||
}, 20)
|
}, 20)
|
||||||
animator.pause();
|
animatora.pause();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("rescale should resume animation if previously playing", function(assert){
|
test("rescale should resume animation if previously playing", function(assert){
|
||||||
@ -61,15 +61,15 @@ test("altering steps should rescale", function(assert){
|
|||||||
|
|
||||||
test("tick should set time to zero if steps are bigger than range", function(assert){
|
test("tick should set time to zero if steps are bigger than range", function(assert){
|
||||||
var done = assert.async();
|
var done = assert.async();
|
||||||
var animator = new torque.Animator(function(){}, {steps: 500, animationDuration: 2});
|
var animatorb = new torque.Animator(function(){}, {steps: 500, animationDuration: 2});
|
||||||
animator.start();
|
animatorb.start();
|
||||||
|
animatorb.step(800);
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
animator._time = 0;
|
console.log(animatorb.step());
|
||||||
animator.step(800);
|
assert.ok(animatorb.step() < 800);
|
||||||
assert.ok(animator.step() < 800);
|
|
||||||
done();
|
done();
|
||||||
}, 20);
|
}, 20);
|
||||||
animator.pause();
|
animatorb.pause();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("tick should pause animation on end if loop is disabled", function(assert){
|
test("tick should pause animation on end if loop is disabled", function(assert){
|
||||||
|
Loading…
Reference in New Issue
Block a user