diff options
author | Scott González <scott.gonzalez@gmail.com> | 2015-04-06 20:28:55 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2015-04-09 09:26:27 -0400 |
commit | a2da340e0d1b02d243c71b86382e5e624e7211d6 (patch) | |
tree | 91726ee56f182a1d2bae81b4d9de68291dc8c876 /tests/unit | |
parent | 7d4811206f8b64e9bd8eea168a77edf23629659b (diff) | |
download | jquery-ui-a2da340e0d1b02d243c71b86382e5e624e7211d6.tar.gz jquery-ui-a2da340e0d1b02d243c71b86382e5e624e7211d6.zip |
Tooltip: Convert tests to new infrastructure
Ref #10119
Ref gh-1528
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/tooltip/tooltip.html | 30 | ||||
-rw-r--r-- | tests/unit/tooltip/tooltip_common.js | 9 | ||||
-rw-r--r-- | tests/unit/tooltip/tooltip_common_deprecated.js | 9 | ||||
-rw-r--r-- | tests/unit/tooltip/tooltip_core.js | 7 | ||||
-rw-r--r-- | tests/unit/tooltip/tooltip_deprecated.html | 28 | ||||
-rw-r--r-- | tests/unit/tooltip/tooltip_deprecated.js | 7 | ||||
-rw-r--r-- | tests/unit/tooltip/tooltip_events.js | 7 | ||||
-rw-r--r-- | tests/unit/tooltip/tooltip_methods.js | 13 | ||||
-rw-r--r-- | tests/unit/tooltip/tooltip_options.js | 7 |
9 files changed, 48 insertions, 69 deletions
diff --git a/tests/unit/tooltip/tooltip.html b/tests/unit/tooltip/tooltip.html index 1a7b94ae2..1f0adc9f4 100644 --- a/tests/unit/tooltip/tooltip.html +++ b/tests/unit/tooltip/tooltip.html @@ -4,34 +4,8 @@ <meta charset="utf-8"> <title>jQuery UI Tooltip Test Suite</title> - <script src="../../jquery.js"></script> - <script> - $.uiBackCompat = false; - </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", "tooltip" ], - js: [ - "ui/core.js", - "ui/widget.js", - "ui/position.js", - "ui/tooltip.js" - ] - }); - </script> - - <script src="tooltip_common.js"></script> - <script src="tooltip_core.js"></script> - <script src="tooltip_events.js"></script> - <script src="tooltip_methods.js"></script> - <script src="tooltip_options.js"></script> - - <script src="../swarminject.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> </head> <body> diff --git a/tests/unit/tooltip/tooltip_common.js b/tests/unit/tooltip/tooltip_common.js index 87e73f7ea..f8045fc33 100644 --- a/tests/unit/tooltip/tooltip_common.js +++ b/tests/unit/tooltip/tooltip_common.js @@ -1,4 +1,9 @@ -TestHelpers.commonWidgetTests( "tooltip", { +define( [ + "lib/common", + "ui/tooltip" +], function( common ) { + +common.testWidget( "tooltip", { defaults: { classes: { "ui-tooltip": "ui-corner-all ui-widget-shadow" @@ -21,3 +26,5 @@ TestHelpers.commonWidgetTests( "tooltip", { open: null } }); + +} ); diff --git a/tests/unit/tooltip/tooltip_common_deprecated.js b/tests/unit/tooltip/tooltip_common_deprecated.js index 6ea0e65ff..d32e7656d 100644 --- a/tests/unit/tooltip/tooltip_common_deprecated.js +++ b/tests/unit/tooltip/tooltip_common_deprecated.js @@ -1,4 +1,9 @@ -TestHelpers.commonWidgetTests( "tooltip", { +define( [ + "lib/common", + "ui/tooltip" +], function( common ) { + +common.testWidget( "tooltip", { defaults: { classes: { "ui-tooltip": "ui-corner-all ui-widget-shadow" @@ -22,3 +27,5 @@ TestHelpers.commonWidgetTests( "tooltip", { open: null } }); + +} ); diff --git a/tests/unit/tooltip/tooltip_core.js b/tests/unit/tooltip/tooltip_core.js index d4520a4ea..fa24d72ce 100644 --- a/tests/unit/tooltip/tooltip_core.js +++ b/tests/unit/tooltip/tooltip_core.js @@ -1,4 +1,7 @@ -(function( $ ) { +define( [ + "jquery", + "ui/tooltip" +], function( $ ) { module( "tooltip: core" ); @@ -218,4 +221,4 @@ asyncTest( "multiple active delegated tooltips", function() { step1(); }); -}( jQuery ) ); +} ); diff --git a/tests/unit/tooltip/tooltip_deprecated.html b/tests/unit/tooltip/tooltip_deprecated.html index 813768337..d21fea57b 100644 --- a/tests/unit/tooltip/tooltip_deprecated.html +++ b/tests/unit/tooltip/tooltip_deprecated.html @@ -4,32 +4,8 @@ <meta charset="utf-8"> <title>jQuery UI Tooltip 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", "tooltip" ], - js: [ - "ui/core.js", - "ui/widget.js", - "ui/position.js", - "ui/tooltip.js" - ] - }); - </script> - - <script src="tooltip_common_deprecated.js"></script> - <script src="tooltip_core.js"></script> - <script src="tooltip_events.js"></script> - <script src="tooltip_methods.js"></script> - <script src="tooltip_options.js"></script> - <script src="tooltip_deprecated.js"></script> - - <script src="../swarminject.js"></script> + <script src="../../lib/css.js" data-modules="core tooltip"></script> + <script src="../../lib/bootstrap.js" data-widget="tooltip" data-deprecated="true"></script> </head> <body> diff --git a/tests/unit/tooltip/tooltip_deprecated.js b/tests/unit/tooltip/tooltip_deprecated.js index a53a27050..057171ee2 100644 --- a/tests/unit/tooltip/tooltip_deprecated.js +++ b/tests/unit/tooltip/tooltip_deprecated.js @@ -1,4 +1,7 @@ -(function( $ ) { +define( [ + "jquery", + "ui/tooltip" +], function( $ ) { module( "tooltip: (deprecated) options" ); @@ -10,4 +13,4 @@ test( "tooltipClass", function( assert ) { assert.hasClasses( $( "#" + element.data( "ui-tooltip-id" ) ), "custom" ); }); -}( jQuery ) ); +} ); diff --git a/tests/unit/tooltip/tooltip_events.js b/tests/unit/tooltip/tooltip_events.js index de16471ae..a953c6e91 100644 --- a/tests/unit/tooltip/tooltip_events.js +++ b/tests/unit/tooltip/tooltip_events.js @@ -1,4 +1,7 @@ -(function( $ ) { +define( [ + "jquery", + "ui/tooltip" +], function( $ ) { module( "tooltip: events" ); @@ -54,4 +57,4 @@ test( "focus events", function() { element.trigger( "focusout" ); }); -}( jQuery ) ); +} ); diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js index f027d5226..3db7b8f7c 100644 --- a/tests/unit/tooltip/tooltip_methods.js +++ b/tests/unit/tooltip/tooltip_methods.js @@ -1,17 +1,20 @@ -(function( $ ) { +define( [ + "jquery", + "ui/tooltip" +], function( $ ) { module( "tooltip: methods" ); -test( "destroy", function() { +test( "destroy", function( assert ) { expect( 3 ); var element = $( "#tooltipped1" ); - domEqual( "#tooltipped1", function() { + assert.domEqual( "#tooltipped1", function() { element.tooltip().tooltip( "destroy" ); }); // make sure that open tooltips are removed on destroy - domEqual( "#tooltipped1", function() { + assert.domEqual( "#tooltipped1", function() { element .tooltip() .tooltip( "open", $.Event( "mouseover", { target: element[0] }) ) @@ -133,4 +136,4 @@ test( "preserve changes to title attributes on close and destroy", function() { } ); }); -}( jQuery ) ); +} ); diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js index 1d9d6b3f0..d091e3bad 100644 --- a/tests/unit/tooltip/tooltip_options.js +++ b/tests/unit/tooltip/tooltip_options.js @@ -1,4 +1,7 @@ -(function( $ ) { +define( [ + "jquery", + "ui/tooltip" +], function( $ ) { module( "tooltip: options" ); @@ -209,4 +212,4 @@ test( "track and programmatic focus", function() { equal( "inputtitle", $( ".ui-tooltip" ).text() ); }); -}( jQuery ) ); +} ); |