diff options
author | Scott González <scott.gonzalez@gmail.com> | 2015-04-06 10:13:15 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2015-04-09 09:24:45 -0400 |
commit | f908a7793bf9e06f3e23d15028baf2e90e92baaa (patch) | |
tree | b9e837d84ddee6fc29e0876a124c099e8703c127 /tests/unit | |
parent | aff3c32ee1f0b81ecea613057e95a40d8edc6b03 (diff) | |
download | jquery-ui-f908a7793bf9e06f3e23d15028baf2e90e92baaa.tar.gz jquery-ui-f908a7793bf9e06f3e23d15028baf2e90e92baaa.zip |
Button: Convert tests to new infrastructure
Ref #10119
Ref gh-1528
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/button/button.html | 26 | ||||
-rw-r--r-- | tests/unit/button/button_common.js | 9 | ||||
-rw-r--r-- | tests/unit/button/button_core.js | 11 | ||||
-rw-r--r-- | tests/unit/button/button_events.js | 10 | ||||
-rw-r--r-- | tests/unit/button/button_methods.js | 14 | ||||
-rw-r--r-- | tests/unit/button/button_options.js | 10 |
6 files changed, 32 insertions, 48 deletions
diff --git a/tests/unit/button/button.html b/tests/unit/button/button.html index 679c316bf..df125867f 100644 --- a/tests/unit/button/button.html +++ b/tests/unit/button/button.html @@ -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> diff --git a/tests/unit/button/button_common.js b/tests/unit/button/button_common.js index 1564a1bee..d376f4f05 100644 --- a/tests/unit/button/button_common.js +++ b/tests/unit/button/button_common.js @@ -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 } }); + +} ); diff --git a/tests/unit/button/button_core.js b/tests/unit/button/button_core.js index 3a6f97325..4bc8d9fe5 100644 --- a/tests/unit/button/button_core.js +++ b/tests/unit/button/button_core.js @@ -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); +} ); diff --git a/tests/unit/button/button_events.js b/tests/unit/button/button_events.js index 2a8bb7727..ec930077c 100644 --- a/tests/unit/button/button_events.js +++ b/tests/unit/button/button_events.js @@ -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); +} ); diff --git a/tests/unit/button/button_methods.js b/tests/unit/button/button_methods.js index d4d92cead..be36096b2 100644 --- a/tests/unit/button/button_methods.js +++ b/tests/unit/button/button_methods.js @@ -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); +} ); diff --git a/tests/unit/button/button_options.js b/tests/unit/button/button_options.js index 7eefe54e1..70470e671 100644 --- a/tests/unit/button/button_options.js +++ b/tests/unit/button/button_options.js @@ -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); +} ); |