diff options
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/menu/menu.html | 27 | ||||
-rw-r--r-- | tests/unit/menu/menu_common.js | 9 | ||||
-rw-r--r-- | tests/unit/menu/menu_core.js | 10 | ||||
-rw-r--r-- | tests/unit/menu/menu_events.js | 16 | ||||
-rw-r--r-- | tests/unit/menu/menu_methods.js | 22 | ||||
-rw-r--r-- | tests/unit/menu/menu_options.js | 16 | ||||
-rw-r--r-- | tests/unit/menu/menu_test_helpers.js | 6 |
7 files changed, 53 insertions, 53 deletions
diff --git a/tests/unit/menu/menu.html b/tests/unit/menu/menu.html index 114382587..5f11f4414 100644 --- a/tests/unit/menu/menu.html +++ b/tests/unit/menu/menu.html @@ -4,31 +4,8 @@ <meta charset="utf-8"> <title>jQuery UI Menu Test Suite</title> - <script src="../../jquery.js"></script> - <link rel="stylesheet" href="../../../external/qunit/qunit.css"> - <script src="../../../external/qunit/qunit.js"></script> - <script src="../../../external/jquery-simulate/jquery.simulate.js"></script> - <script src="../testsuite.js"></script> - <script src="../../../external/qunit-assert-classes/qunit-assert-classes.js"></script> - <script> - TestHelpers.loadResources({ - css: [ "core", "menu" ], - js: [ - "ui/core.js", - "ui/widget.js", - "ui/menu.js" - ] - }); - </script> - - <script src="menu_test_helpers.js"></script> - <script src="menu_common.js"></script> - <script src="menu_core.js"></script> - <script src="menu_events.js"></script> - <script src="menu_methods.js"></script> - <script src="menu_options.js"></script> - - <script src="../swarminject.js"></script> + <script src="../../lib/css.js" data-modules="core menu"></script> + <script src="../../lib/bootstrap.js" data-widget="menu"></script> <style> .ui-menu { font-size: 15px; diff --git a/tests/unit/menu/menu_common.js b/tests/unit/menu/menu_common.js index 942e9e9f9..0f0a04de8 100644 --- a/tests/unit/menu/menu_common.js +++ b/tests/unit/menu/menu_common.js @@ -1,4 +1,9 @@ -TestHelpers.commonWidgetTests( "menu", { +define( [ + "lib/common", + "ui/menu" +], function( common ) { + +common.testWidget( "menu", { defaults: { classes: {}, disabled: false, @@ -20,3 +25,5 @@ TestHelpers.commonWidgetTests( "menu", { select: null } }); + +} ); diff --git a/tests/unit/menu/menu_core.js b/tests/unit/menu/menu_core.js index 9c3ba873a..3dd2c78e1 100644 --- a/tests/unit/menu/menu_core.js +++ b/tests/unit/menu/menu_core.js @@ -1,4 +1,8 @@ -(function( $ ) { +define( [ + "jquery", + "./menu_test_helpers", + "ui/menu" +], function( $, menuTestHelpers ) { module( "menu: core" ); @@ -47,7 +51,7 @@ asyncTest( "#9044: Autofocus issue with dialog opened from menu widget", functio $( "#test9044" ).focus(); }); - TestHelpers.menu.click( element, "3" ); + menuTestHelpers.click( element, "3" ); setTimeout( function() { equal( document.activeElement.id, "test9044", "Focus was swallowed by menu" ); $( "#test9044" ).remove(); @@ -69,4 +73,4 @@ asyncTest( "#9532: Need a way in Menu to keep ui-state-active class on selected }); }); -})( jQuery ); +} ); diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js index bda2d6050..9aed1839c 100644 --- a/tests/unit/menu/menu_events.js +++ b/tests/unit/menu/menu_events.js @@ -1,12 +1,16 @@ -(function( $ ) { +define( [ + "jquery", + "./menu_test_helpers", + "ui/menu" +], function( $, menuTestHelpers ) { -var log = TestHelpers.menu.log, - logOutput = TestHelpers.menu.logOutput, - click = TestHelpers.menu.click; +var log = menuTestHelpers.log, + logOutput = menuTestHelpers.logOutput, + click = menuTestHelpers.click; module( "menu: events", { setup: function() { - TestHelpers.menu.clearLog(); + menuTestHelpers.clearLog(); } }); @@ -730,4 +734,4 @@ asyncTest( "#10571: When typing in a menu, only menu-items should be focused", f }); }); -})( jQuery ); +} ); diff --git a/tests/unit/menu/menu_methods.js b/tests/unit/menu/menu_methods.js index 840ccbd17..ad30e5f13 100644 --- a/tests/unit/menu/menu_methods.js +++ b/tests/unit/menu/menu_methods.js @@ -1,21 +1,25 @@ -(function( $ ) { +define( [ + "jquery", + "./menu_test_helpers", + "ui/menu" +], function( $, menuTestHelpers ) { -var log = TestHelpers.menu.log, - logOutput = TestHelpers.menu.logOutput, - click = TestHelpers.menu.click; +var log = menuTestHelpers.log, + logOutput = menuTestHelpers.logOutput, + click = menuTestHelpers.click; module( "menu: methods", { setup: function() { - TestHelpers.menu.clearLog(); + menuTestHelpers.clearLog(); } }); -test( "destroy", function() { +test( "destroy", function( assert ) { expect( 2 ); - domEqual( "#menu2", function() { + assert.domEqual( "#menu2", function() { $( "#menu2" ).menu().menu( "destroy" ); }); - domEqual( "#menu5", function() { + assert.domEqual( "#menu5", function() { $( "#menu5").menu().menu( "destroy" ); }); }); @@ -109,4 +113,4 @@ test( "widget", function() { // TODO: test select method -})( jQuery ); +} ); diff --git a/tests/unit/menu/menu_options.js b/tests/unit/menu/menu_options.js index 3df547334..91630e14b 100644 --- a/tests/unit/menu/menu_options.js +++ b/tests/unit/menu/menu_options.js @@ -1,12 +1,16 @@ -(function( $ ) { +define( [ + "jquery", + "./menu_test_helpers", + "ui/menu" +], function( $, menuTestHelpers ) { -var log = TestHelpers.menu.log, - logOutput = TestHelpers.menu.logOutput, - click = TestHelpers.menu.click; +var log = menuTestHelpers.log, + logOutput = menuTestHelpers.logOutput, + click = menuTestHelpers.click; module( "menu: options", { setup: function() { - TestHelpers.menu.clearLog(); + menuTestHelpers.clearLog(); } }); @@ -118,4 +122,4 @@ test( "{ role: null }", function( assert ) { }); }); -})( jQuery ); +} ); diff --git a/tests/unit/menu/menu_test_helpers.js b/tests/unit/menu/menu_test_helpers.js index ea273c765..bfed14d74 100644 --- a/tests/unit/menu/menu_test_helpers.js +++ b/tests/unit/menu/menu_test_helpers.js @@ -1,9 +1,9 @@ -(function() { +define( function() { var lastItem, log = []; -TestHelpers.menu = { +return { log: function( message, clear ) { if ( clear ) { log.length = 0; @@ -30,4 +30,4 @@ TestHelpers.menu = { } }; -})(); +} ); |