2
0
Эх сурвалжийг харах

Add isScheduled and startAt unittests in the sources

gero3 7 жил өмнө
parent
commit
8e6e4a65a8

+ 27 - 5
test/unit/src/animation/AnimationAction.tests.js

@@ -122,19 +122,41 @@ export default QUnit.module( 'Animation', () => {
             animationAction.enabled = false;
             animationAction.enabled = false;
 			assert.notOk( animationAction.isRunning(), "When an animation is not enabled, it is not running." );
 			assert.notOk( animationAction.isRunning(), "When an animation is not enabled, it is not running." );
             animationAction.enabled = true;
             animationAction.enabled = true;
-			assert.Ok( animationAction.isRunning(), "When an animation is enabled, it is running." );
+			assert.ok( animationAction.isRunning(), "When an animation is enabled, it is running." );
 
 
 		} );
 		} );
 
 
-		QUnit.todo( "isScheduled", ( assert ) => {
+		QUnit.test( "isScheduled", ( assert ) => {
 
 
-			assert.ok( false, "everything's gonna be alright" );
+			var {mixer,animationAction} = createAnimation();
+			assert.notOk( animationAction.isScheduled(), "When an animation is just made, it is not scheduled." );
+            animationAction.play();
+            assert.ok( animationAction.isScheduled(), "When an animation is started, it is scheduled." );
+            mixer.update(1);
+            assert.ok( animationAction.isScheduled(), "When an animation is updated, it is scheduled." );
+            animationAction.stop();
+            assert.notOk( animationAction.isScheduled(), "When an animation is stopped, it isn't scheduled anymore." );
 
 
+           
 		} );
 		} );
 
 
-		QUnit.todo( "startAt", ( assert ) => {
+		QUnit.test( "startAt", ( assert ) => {
 
 
-			assert.ok( false, "everything's gonna be alright" );
+			var {mixer,animationAction} = createAnimation();
+            animationAction.startAt(2);
+            animationAction.play();
+            assert.notOk( animationAction.isRunning(), "When an animation is started at a specific time, it is not running." );
+			assert.ok( animationAction.isScheduled(), "When an animation is started at a specific time, it is scheduled." );
+            mixer.update(1);
+            assert.notOk( animationAction.isRunning(), "When an animation is started at a specific time and the interval is not passed, it is not running." );
+			assert.ok( animationAction.isScheduled(), "When an animation is started at a specific time and the interval is not passed, it is scheduled." );
+            mixer.update(1);
+            assert.ok( animationAction.isRunning(), "When an animation is started at a specific time and the interval is passed, it is running." );
+			assert.ok( animationAction.isScheduled(), "When an animation is started at a specific time and the interval is passed, it is scheduled." );
+            animationAction.stop();
+            assert.notOk( animationAction.isRunning(), "When an animation is stopped, it is not running." );
+			assert.notOk( animationAction.isScheduled(), "When an animation is stopped, it is not scheduled." );
+            
 
 
 		} );
 		} );