aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/widget/widget_animation.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2015-04-07 10:55:52 -0400
committerScott González <scott.gonzalez@gmail.com>2015-04-09 09:27:00 -0400
commitbde431bb449b1d957d4e0b736111ff342f2a919d (patch)
tree27fd40037c30dbff8ef3b6113e90817ab96b53bf /tests/unit/widget/widget_animation.js
parentdc4b015a8b9acdb5bff2d5dd89737b3d8b64097f (diff)
downloadjquery-ui-bde431bb449b1d957d4e0b736111ff342f2a919d.tar.gz
jquery-ui-bde431bb449b1d957d4e0b736111ff342f2a919d.zip
Tests: Rename files
Ref gh-1528
Diffstat (limited to 'tests/unit/widget/widget_animation.js')
-rw-r--r--tests/unit/widget/widget_animation.js263
1 files changed, 0 insertions, 263 deletions
diff --git a/tests/unit/widget/widget_animation.js b/tests/unit/widget/widget_animation.js
deleted file mode 100644
index 4e9d93ccf..000000000
--- a/tests/unit/widget/widget_animation.js
+++ /dev/null
@@ -1,263 +0,0 @@
-define( [
- "jquery",
- "ui/widget"
-], function( $ ) {
-
-module( "widget animation", (function() {
- var show = $.fn.show,
- fadeIn = $.fn.fadeIn,
- slideDown = $.fn.slideDown;
- return {
- setup: function() {
- $.widget( "ui.testWidget", {
- _create: function() {
- this.element.hide();
- },
- show: function( fn ) {
- this._show( this.element, this.options.show, fn );
- }
- });
- $.effects = { effect: { testEffect: $.noop } };
- },
- teardown: function() {
- delete $.ui.testWidget;
- delete $.effects.effect.testEffect;
- $.fn.show = show;
- $.fn.fadeIn = fadeIn;
- $.fn.slideDown = slideDown;
- }
- };
-}()));
-
-asyncTest( "show: null", function() {
- expect( 4 );
-
- var element = $( "#widget" ).testWidget(),
- hasRun = false;
- $.fn.show = function() {
- ok( true, "show called" );
- equal( arguments.length, 0, "no args passed to show" );
- };
-
- element
- .delay( 50 )
- .queue(function( next ) {
- ok( !hasRun, "queue before show" );
- next();
- })
- .testWidget( "show", function() {
- hasRun = true;
- })
- .queue(function( next ) {
- ok( hasRun, "queue after show" );
- start();
- next();
- });
-});
-
-asyncTest( "show: true", function() {
- expect( 4 );
-
- var element = $( "#widget" ).testWidget({
- show: true
- }),
- hasRun = false;
- $.fn.fadeIn = function( duration, easing, complete ) {
- return this.queue(function( next ) {
- strictEqual( duration, undefined, "duration" );
- strictEqual( easing, undefined, "easing" );
- complete();
- next();
- });
- };
-
- element
- .delay( 50 )
- .queue(function( next ) {
- ok( !hasRun, "queue before show" );
- next();
- })
- .testWidget( "show", function() {
- hasRun = true;
- })
- .queue(function( next ) {
- ok( hasRun, "queue after show" );
- start();
- next();
- });
-});
-
-asyncTest( "show: number", function() {
- expect( 4 );
-
- var element = $( "#widget" ).testWidget({
- show: 123
- }),
- hasRun = false;
- $.fn.fadeIn = function( duration, easing, complete ) {
- return this.queue(function( next ) {
- strictEqual( duration, 123, "duration" );
- strictEqual( easing, undefined, "easing" );
- complete();
- next();
- });
- };
-
- element
- .delay( 50 )
- .queue(function( next ) {
- ok( !hasRun, "queue before show" );
- next();
- })
- .testWidget( "show", function() {
- hasRun = true;
- })
- .queue(function( next ) {
- ok( hasRun, "queue after show" );
- start();
- next();
- });
-});
-
-asyncTest( "show: core animation", function() {
- expect( 4 );
-
- var element = $( "#widget" ).testWidget({
- show: "slideDown"
- }),
- hasRun = false;
- $.fn.slideDown = function( duration, easing, complete ) {
- return this.queue(function( next ) {
- strictEqual( duration, undefined, "duration" );
- strictEqual( easing, undefined, "easing" );
- complete();
- next();
- });
- };
-
- element
- .delay( 50 )
- .queue(function( next ) {
- ok( !hasRun, "queue before show" );
- next();
- })
- .testWidget( "show", function() {
- hasRun = true;
- })
- .queue(function( next ) {
- ok( hasRun, "queue after show" );
- start();
- next();
- });
-});
-
-asyncTest( "show: effect", function() {
- expect( 5 );
-
- var element = $( "#widget" ).testWidget({
- show: "testEffect"
- }),
- hasRun = false;
- $.fn.show = function( options ) {
- return this.queue(function( next ) {
- equal( options.effect, "testEffect", "effect" );
- ok( !("duration" in options), "duration" );
- ok( !("easing" in options), "easing" );
- options.complete();
- next();
- });
- };
-
- element
- .delay( 50 )
- .queue(function( next ) {
- ok( !hasRun, "queue before show" );
- next();
- })
- .testWidget( "show", function() {
- hasRun = true;
- })
- .queue(function( next ) {
- ok( hasRun, "queue after show" );
- start();
- next();
- });
-});
-
-asyncTest( "show: object(core animation)", function() {
- expect( 4 );
-
- var element = $( "#widget" ).testWidget({
- show: {
- effect: "slideDown",
- duration: 123,
- easing: "testEasing"
- }
- }),
- hasRun = false;
- $.fn.slideDown = function( duration, easing, complete ) {
- return this.queue(function( next ) {
- equal( duration, 123, "duration" );
- equal( easing, "testEasing", "easing" );
- complete();
- next();
- });
- };
-
- element
- .delay( 50 )
- .queue(function( next ) {
- ok( !hasRun, "queue before show" );
- next();
- })
- .testWidget( "show", function() {
- hasRun = true;
- })
- .queue(function( next ) {
- ok( hasRun, "queue after show" );
- start();
- next();
- });
-});
-
-asyncTest( "show: object(effect)", function() {
- expect( 3 );
-
- var element = $( "#widget" ).testWidget({
- show: {
- effect: "testEffect",
- duration: 123,
- easing: "testEasing"
- }
- }),
- hasRun = false;
- $.fn.show = function( options ) {
- return this.queue(function( next ) {
- deepEqual( options, {
- effect: "testEffect",
- duration: 123,
- easing: "testEasing",
- complete: options.complete
- });
- options.complete();
- next();
- });
- };
-
- element
- .delay( 50 )
- .queue(function( next ) {
- ok( !hasRun, "queue before show" );
- next();
- })
- .testWidget( "show", function() {
- hasRun = true;
- })
- .queue(function( next ) {
- ok( hasRun, "queue after show" );
- start();
- next();
- });
-});
-
-} );