9 describe('Fx', function(){
11 Object.each(Fx.Transitions, function(value, transition){
12 if (transition == 'extend') return;
14 it('should start a Fx and call the onComplete event with ' + transition + ' as timing function', function(){
16 var onComplete = jasmine.createSpy('complete'),
17 onStart = jasmine.createSpy('start');
21 transition: Fx.Transitions[transition],
22 onComplete: onComplete,
26 expect(onStart).not.toHaveBeenCalled();
30 expect(onStart).toHaveBeenCalled();
31 expect(onComplete).not.toHaveBeenCalled();
33 waitsFor(300, function(){
34 return onComplete.wasCalled;
38 expect(onComplete).toHaveBeenCalled();
44 it('should cancel a Fx', function(){
46 var onCancel = jasmine.createSpy();
50 transition: 'sine:in:out',
56 expect(onCancel).not.toHaveBeenCalled();
60 expect(onCancel).toHaveBeenCalled();
64 it('should set the computed value', function(){
66 var FxLog = new Class({
68 set: function(current){
80 expect(fx.foo).toEqual(10);
85 it('should pause and resume', function(){
87 var FxLog = new Class({
89 set: function(current){
105 expect(fx.foo).toBeGreaterThan(0);
106 expect(fx.foo).toBeLessThan(1);
112 expect(fx.foo).toEqual(value);
119 expect(fx.foo).toEqual(1);
124 it('should chain the Fx', function(){
129 onComplete: function(){
140 expect(counter).toEqual(2);
144 it('should cancel the Fx after a new Fx:start with the link = cancel option', function(){
146 var onCancel = jasmine.createSpy('cancel');
156 expect(onCancel).toHaveBeenCalled();