1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-30 20:10:28 +00:00
TiddlyWiki5/editions/tw2/source/tiddlywiki/test/js/Animator.js
2012-11-16 21:20:27 +00:00

33 lines
1.1 KiB
JavaScript
Executable File

jQuery(document).ready(function(){
module("Animator");
test("Animator : constructor", function() {
var a = new Animator();
same(typeof a,'object','the Animator() constructor should return an object');
same(a.running,0,'the object returned by the Animator() constructor should contain a \'running\' integer with a value of 0 ');
same(a.timerID,0,'the object returned by the Animator() constructor should contain a \'timerID\' integer with a value of 0 ');
same(a.animations.length,0,'the object returned by the Animator() constructor should contain an empty \'animations\' array');
});
test("Animator : functions", function() {
var expected = ".2061";
var actual = Animator.slowInSlowOut(0.3);
actual = actual.toString().substr(1,5);
same(actual,expected,'given a float value, Animator.slowInSlowOut() returns the result of the correct mathematical transformation.');
expected = 0;
actual = Animator.slowInSlowOut(2);
same(actual,expected,'given a value above the max of valid input, Animator.slowInSlowOut() clamps its output appropriately.');
});
});