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

tests/unit/button/button.html
tests/unit/button/button_common.js
tests/unit/button/button_core.js
tests/unit/button/button_events.js
tests/unit/button/button_methods.js
tests/unit/button/button_options.js

index 679c316bfb72307ba8851a3e6a96bd02258c03f0..df125867f330d48ba59f97eb02903d6dbb239ee0 100644 (file)
@@ -4,30 +4,8 @@
        <meta charset="utf-8">
        <title>jQuery UI Button 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", "button" ],
-               js: [
-                       "ui/core.js",
-                       "ui/widget.js",
-                       "ui/button.js"
-               ]
-       });
-       </script>
-
-       <script src="button_common.js"></script>
-       <script src="button_core.js"></script>
-       <script src="button_events.js"></script>
-       <script src="button_methods.js"></script>
-       <script src="button_options.js"></script>
-
-       <script src="../swarminject.js"></script>
+       <script src="../../lib/css.js" data-modules="core button"></script>
+       <script src="../../lib/bootstrap.js" data-widget="button"></script>
 </head>
 <body>
 
index 1564a1beeee6bc488e781da13e084df87270b9d6..d376f4f05aa421f6903f74370699c82d4e8e16d7 100644 (file)
@@ -1,4 +1,9 @@
-TestHelpers.commonWidgetTests( "button", {
+define( [
+       "lib/common",
+       "ui/button"
+], function( common ) {
+
+common.testWidget( "button", {
        defaults: {
                classes: {},
                disabled: null,
@@ -13,3 +18,5 @@ TestHelpers.commonWidgetTests( "button", {
                create: null
        }
 });
+
+} );
index 3a6f97325e614f03b368f514db3ab4583a5d495e..4bc8d9fe5ae3fdae1eeed233d137cf014d6a9fe5 100644 (file)
@@ -1,8 +1,7 @@
-/*
- * button_core.js
- */
-
-(function($) {
+define( [
+       "jquery",
+       "ui/button"
+], function( $ ) {
 
 module("button: core");
 
@@ -228,4 +227,4 @@ asyncTest( "#9169 - Disabled button maintains ui-state-focus", function( assert
        });
 });
 
-})(jQuery);
+} );
index 2a8bb7727278dd3364896f05710357363c4404c1..ec930077caafaff841515c9e002472b748d1165b 100644 (file)
@@ -1,7 +1,7 @@
-/*
- * button_events.js
- */
-(function($) {
+define( [
+       "jquery",
+       "ui/button"
+], function( $ ) {
 
 module("button: events");
 
@@ -33,4 +33,4 @@ asyncTest( "when button loses focus, ensure active state is removed (#8559)", fu
        });
 });
 
-})(jQuery);
+} );
index d4d92cead0999147138c94c1bb54288c352fe101..be36096b22e3853dbfc6663ed0644c5ff073dead 100644 (file)
@@ -1,13 +1,13 @@
-/*
- * button_methods.js
- */
-(function($) {
+define( [
+       "jquery",
+       "ui/button"
+], function( $ ) {
 
 module("button: methods");
 
-test("destroy", function() {
+test("destroy", function( assert ) {
        expect( 1 );
-       domEqual( "#button", function() {
+       assert.domEqual( "#button", function() {
                $( "#button" ).button().button( "destroy" );
        });
 });
@@ -70,4 +70,4 @@ test( "refresh: buttonset should turn added elements into button widgets", funct
        equal( checkboxButtonset.find( ":ui-button" ).length, 4, "checkbox" );
 });
 
-})(jQuery);
+} );
index 7eefe54e150dd7d97324c6f2a013ffcf9f2c1682..70470e671a102409bf64834c7351981ddb21bb6d 100644 (file)
@@ -1,7 +1,7 @@
-/*
- * button_options.js
- */
-(function($) {
+define( [
+       "jquery",
+       "ui/button"
+], function( $ ) {
 
 module( "button: options" );
 
@@ -154,4 +154,4 @@ test( "#5295 - button does not remove hoverstate if disabled" , function( assert
        assert.lacksClasses( btn, "ui-state-hover" );
 });
 
-})(jQuery);
+} );