diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/bootstrap.js | 20 | ||||
-rw-r--r-- | tests/unit/button/button.html | 2 | ||||
-rw-r--r-- | tests/unit/dialog/dialog.html | 2 | ||||
-rw-r--r-- | tests/unit/droppable/droppable.html | 3 | ||||
-rw-r--r-- | tests/unit/tabs/core.js | 6 | ||||
-rw-r--r-- | tests/unit/tooltip/tooltip.html | 2 |
6 files changed, 18 insertions, 17 deletions
diff --git a/tests/lib/bootstrap.js b/tests/lib/bootstrap.js index fd9b1eb65..e0df9ebf5 100644 --- a/tests/lib/bootstrap.js +++ b/tests/lib/bootstrap.js @@ -25,9 +25,9 @@ requirejs.config( { } } ); -// Create a module that disables back compat for UI modules -define( "jquery-no-back-compat", [ "jquery" ], function( $ ) { - $.uiBackCompat = false; +// Create a module that enables back compat for UI modules +define( "jquery-back-compat", [ "jquery" ], function( $ ) { + $.uiBackCompat = true; return $; } ); @@ -53,10 +53,12 @@ function requireModules( dependencies, callback, modules ) { } // Load a set of test file along with the required test infrastructure -function requireTests( dependencies, noBackCompat ) { - var preDependencies = [ +function requireTests( dependencies, options ) { + + var backCompat = !!( options && options.backCompat ), + preDependencies = [ "lib/qunit", - noBackCompat ? "jquery-no-back-compat" : "jquery", + backCompat ? "jquery-back-compat" : "jquery", "jquery-simulate" ]; @@ -136,7 +138,7 @@ function migrateUrl() { // - data-widget: A widget to load test modules for // - Automatically loads common, core, events, methods, and options // - data-deprecated: Loads the deprecated test modules for a widget -// - data-no-back-compat: Set $.uiBackCompat to false +// - data-back-compat: Set $.uiBackCompat to `true` ( function() { // Find the script element @@ -154,7 +156,7 @@ function migrateUrl() { } var widget = script.getAttribute( "data-widget" ); var deprecated = !!script.getAttribute( "data-deprecated" ); - var noBackCompat = !!script.getAttribute( "data-no-back-compat" ); + var backCompat = !!script.getAttribute( "data-back-compat" ); if ( widget ) { modules = modules.concat( [ @@ -177,7 +179,7 @@ function migrateUrl() { modules.unshift( "ui/jquery-patch" ); } - requireTests( modules, noBackCompat ); + requireTests( modules, { backCompat: backCompat } ); } )(); } )(); diff --git a/tests/unit/button/button.html b/tests/unit/button/button.html index 6cf27fb33..1c3d10199 100644 --- a/tests/unit/button/button.html +++ b/tests/unit/button/button.html @@ -6,7 +6,7 @@ <script src="../../../external/requirejs/require.js"></script> <script src="../../lib/css.js" data-modules="core button"></script> - <script src="../../lib/bootstrap.js" data-widget="button" data-no-back-compat="true"></script> + <script src="../../lib/bootstrap.js" data-widget="button"></script> </head> <body> diff --git a/tests/unit/dialog/dialog.html b/tests/unit/dialog/dialog.html index bdba5e11c..30f22c60e 100644 --- a/tests/unit/dialog/dialog.html +++ b/tests/unit/dialog/dialog.html @@ -6,7 +6,7 @@ <script src="../../../external/requirejs/require.js"></script> <script src="../../lib/css.js" data-modules="core button dialog"></script> - <script src="../../lib/bootstrap.js" data-widget="dialog" data-no-back-compat="true"></script> + <script src="../../lib/bootstrap.js" data-widget="dialog"></script> </head> <body> diff --git a/tests/unit/droppable/droppable.html b/tests/unit/droppable/droppable.html index 5c3ec3dd9..e507bb561 100644 --- a/tests/unit/droppable/droppable.html +++ b/tests/unit/droppable/droppable.html @@ -6,8 +6,7 @@ <script src="../../../external/requirejs/require.js"></script> <script src="../../lib/css.js" data-modules="core"></script> - <script src="../../lib/bootstrap.js" data-widget="droppable" - data-no-back-compat="true"></script> + <script src="../../lib/bootstrap.js" data-widget="droppable"></script> </head> <body> diff --git a/tests/unit/tabs/core.js b/tests/unit/tabs/core.js index 7637cfb1f..0f9e7acbb 100644 --- a/tests/unit/tabs/core.js +++ b/tests/unit/tabs/core.js @@ -29,9 +29,9 @@ QUnit.test( "markup structure", function( assert ) { assert.hasClasses( tabs[ 2 ], "ui-tabs-tab" ); // DEPRECATED - assert.hasClasses( tabs[ 0 ], "ui-tab" ); - assert.hasClasses( tabs[ 1 ], "ui-tab" ); - assert.hasClasses( tabs[ 2 ], "ui-tab" ); + assert.lacksClasses( tabs[ 0 ], "ui-tab" ); + assert.lacksClasses( tabs[ 1 ], "ui-tab" ); + assert.lacksClasses( tabs[ 2 ], "ui-tab" ); assert.equal( tabs.length, 3, "There are exactly three tabs" ); assert.hasClasses( anchors[ 0 ], "ui-tabs-anchor" ); diff --git a/tests/unit/tooltip/tooltip.html b/tests/unit/tooltip/tooltip.html index b5561d926..8c6dec70d 100644 --- a/tests/unit/tooltip/tooltip.html +++ b/tests/unit/tooltip/tooltip.html @@ -6,7 +6,7 @@ <script src="../../../external/requirejs/require.js"></script> <script src="../../lib/css.js" data-modules="core tooltip"></script> - <script src="../../lib/bootstrap.js" data-widget="tooltip" data-no-back-compat="true"></script> + <script src="../../lib/bootstrap.js" data-widget="tooltip"></script> </head> <body> |