]> source.dussan.org Git - jquery-ui.git/commitdiff
Selectmenu: Convert tests to new infrastructure
authorScott González <scott.gonzalez@gmail.com>
Mon, 6 Apr 2015 18:40:47 +0000 (14:40 -0400)
committerScott González <scott.gonzalez@gmail.com>
Thu, 9 Apr 2015 13:26:26 +0000 (09:26 -0400)
Ref #10119
Ref gh-1528

tests/unit/selectmenu/selectmenu.html
tests/unit/selectmenu/selectmenu_common.js
tests/unit/selectmenu/selectmenu_core.js
tests/unit/selectmenu/selectmenu_events.js
tests/unit/selectmenu/selectmenu_methods.js
tests/unit/selectmenu/selectmenu_options.js

index c9a399ad5482e20ecc45da84260278cc3b106f65..0583733a0d0c051d628b75c1d76a1e95de371620 100644 (file)
@@ -4,32 +4,8 @@
        <meta charset="utf-8">
        <title>jQuery UI Selectmenu 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" , "selectmenu" ],
-               js: [
-                       "ui/core.js",
-                       "ui/widget.js",
-                       "ui/position.js",
-                       "ui/menu.js",
-                       "ui/selectmenu.js"
-               ]
-       });
-       </script>
-
-       <script src="selectmenu_common.js"></script>
-       <script src="selectmenu_core.js"></script>
-       <script src="selectmenu_events.js"></script>
-       <script src="selectmenu_methods.js"></script>
-       <script src="selectmenu_options.js"></script>
-
-       <script src="../swarminject.js"></script>
+       <script src="../../lib/css.js" data-modules="core menu selectmenu"></script>
+       <script src="../../lib/bootstrap.js" data-widget="selectmenu"></script>
 </head>
 <body>
 
index f741eaf27e0c502b0a9a8a760e7791b3b4dd00b8..b24b8dace85e6fc9982634677c6eab2d1f6a1c2a 100644 (file)
@@ -1,4 +1,9 @@
-TestHelpers.commonWidgetTests( "selectmenu", {
+define( [
+       "lib/common",
+       "ui/selectmenu"
+], function( common ) {
+
+common.testWidget( "selectmenu", {
        defaults: {
                appendTo: null,
                classes: {
@@ -25,3 +30,5 @@ TestHelpers.commonWidgetTests( "selectmenu", {
                select: null
        }
 });
+
+} );
index c4e98775121a8da712058fa0cd6b6a7f7ff7bcd4..e5807817ee413d4fa4b328ae6674088fbb3c4dbf 100644 (file)
@@ -1,4 +1,7 @@
-(function( $ ) {
+define( [
+       "jquery",
+       "ui/selectmenu"
+], function( $ ) {
 
 module( "selectmenu: core" );
 
@@ -326,4 +329,4 @@ $.each([
        });
 });
 
-})( jQuery );
+} );
index 3ab6e93bc68a45ec5ac64798c01507cd8b320adf..d5c463fa9106bcb0ec62f9ce40289147abf75a38 100644 (file)
@@ -1,4 +1,7 @@
-(function ( $ ) {
+define( [
+       "jquery",
+       "ui/selectmenu"
+], function( $ ) {
 
 module( "selectmenu: events", {
        setup: function() {
@@ -130,4 +133,4 @@ asyncTest( "select", function() {
        });
 });
 
-})( jQuery );
+} );
index 8f5454b15880f9c00804f82bdc98e6e4e5b3c62c..8481e804e08fb4e954fb855a39d626dedf1423f1 100644 (file)
@@ -1,10 +1,13 @@
-(function( $ ) {
+define( [
+       "jquery",
+       "ui/selectmenu"
+], function( $ ) {
 
 module( "selectmenu: methods" );
 
-test( "destroy", function() {
+test( "destroy", function( assert ) {
        expect( 1 );
-       domEqual( "#speed", function() {
+       assert.domEqual( "#speed", function() {
                $( "#speed" ).selectmenu().selectmenu( "destroy" );
        });
 });
@@ -183,4 +186,4 @@ test( "widget and menuWidget", function( assert ) {
        ok( menu.is( "ul.ui-menu" ), "Menu Widget: element and class" );
 });
 
-})( jQuery );
+} );
index 7ed841a90a8b681eb1478587264eb43df3c32cb0..deb7a6d3a1d909697e0a3d372d018fa5b3e06ebd 100644 (file)
@@ -1,4 +1,7 @@
-(function ( $ ) {
+define( [
+       "jquery",
+       "ui/selectmenu"
+], function( $ ) {
 
 module( "selectmenu: options" );
 
@@ -122,4 +125,4 @@ test( "width", function() {
        equal( button.outerWidth(), 300, "button width fills container" );
 });
 
-})( jQuery );
+} );