~bac/juju-gui/trunkcopy

« back to all changes in this revision

Viewing changes to lib/yui/tests/anim/tests/anim-easing-test.js

  • Committer: kapil.foss at gmail
  • Date: 2012-07-13 18:45:59 UTC
  • Revision ID: kapil.foss@gmail.com-20120713184559-2xl7be17egsrz0c9
reshape

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
YUI.add('anim-easing-test', function(Y) {
2
 
    function onEnd() {
3
 
        this.resume(function() {
4
 
            Y.Assert.areEqual('0px', node.getComputedStyle('height'));
5
 
            node.setStyle('height', '');
6
 
        });
7
 
    }
8
 
    
9
 
    var node = Y.one('.demo'),
10
 
        testCase = new Y.Test.Case({
11
 
            name: 'Anim Easing'
12
 
        });
13
 
 
14
 
 
15
 
    function addTest(easing) {
16
 
        testCase['should end at the final value for ' + easing] = function() {
17
 
            var anim = new Y.Anim({
18
 
                node: node,
19
 
                easing: easing,
20
 
                to: {
21
 
                    height: 0,
22
 
                },
23
 
 
24
 
                duration: 0.25,
25
 
            });
26
 
            
27
 
            anim.on('end', onEnd, this);
28
 
            anim.run();
29
 
            this.wait(500);
30
 
        }
31
 
    }
32
 
 
33
 
    Y.Object.each(Y.Easing, function(fn, name) {
34
 
        addTest(name); // test string
35
 
    });
36
 
 
37
 
    Y.Test.Runner.add(testCase);
38
 
}, '@VERSION@' ,{requires:['anim-easing', 'test']});