]> source.dussan.org Git - jquery-ui.git/commitdiff
Progressbar: Convert tests to new infrastructure
authorScott González <scott.gonzalez@gmail.com>
Mon, 6 Apr 2015 18:27:05 +0000 (14:27 -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/progressbar/progressbar.html
tests/unit/progressbar/progressbar_common.js
tests/unit/progressbar/progressbar_core.js
tests/unit/progressbar/progressbar_events.js
tests/unit/progressbar/progressbar_methods.js
tests/unit/progressbar/progressbar_options.js

index 1dae6b666ae82fb8ae8541827a27f484b23106cd..351ed4e2180ab596d8e62db8da098c3a9b195e57 100644 (file)
@@ -4,30 +4,8 @@
        <meta charset="utf-8">
        <title>jQuery UI Progressbar 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", "progressbar" ],
-               js: [
-                       "ui/core.js",
-                       "ui/widget.js",
-                       "ui/progressbar.js"
-               ]
-       });
-       </script>
-
-       <script src="progressbar_common.js"></script>
-       <script src="progressbar_core.js"></script>
-       <script src="progressbar_events.js"></script>
-       <script src="progressbar_methods.js"></script>
-       <script src="progressbar_options.js"></script>
-
-       <script src="../swarminject.js"></script>
+       <script src="../../lib/css.js" data-modules="core progressbar"></script>
+       <script src="../../lib/bootstrap.js" data-widget="progressbar"></script>
 </head>
 <body>
 
index 0608f09f7922dc88cf3db3e56a3af2b6e8afff80..c949f136f9c8a5ef65b9a0b4c4f01f24772452f9 100644 (file)
@@ -1,4 +1,9 @@
-TestHelpers.commonWidgetTests( "progressbar", {
+define( [
+       "lib/common",
+       "ui/progressbar"
+], function( common ) {
+
+common.testWidget( "progressbar", {
        defaults: {
                classes: {
                        "ui-progressbar": "ui-corner-all",
@@ -15,3 +20,5 @@ TestHelpers.commonWidgetTests( "progressbar", {
                create: null
        }
 });
+
+} );
index 60ff3141128328852cf96764256cbdd11598b052..05eea9ef7b191abcf68eac09ae6589b39e5020b3 100644 (file)
@@ -1,4 +1,7 @@
-(function( $ ) {
+define( [
+       "jquery",
+       "ui/progressbar"
+], function( $ ) {
 
 module( "progressbar: core" );
 
@@ -58,4 +61,4 @@ test( "accessibility", function() {
        equal( element.attr( "aria-valuenow" ), null, "aria-valuenow" );
 });
 
-}( jQuery ) );
+} );
index ed3da169aafb4f0645e498872fc20b1d3ea105bc..a40b2c43218b0ee83809645e2b81b33611a70589 100644 (file)
@@ -1,4 +1,7 @@
-(function( $ ) {
+define( [
+       "jquery",
+       "ui/progressbar"
+], function( $ ) {
 
 module( "progressbar: events" );
 
@@ -52,4 +55,4 @@ test( "complete", function() {
        element.progressbar( "value", value );
 });
 
-}( jQuery ) );
+} );
index c665566b53b1b0ad1f8b61184bb57309787c42d1..eaf0a5c76655024e883eb1454575fbc20c8ba8c3 100644 (file)
@@ -1,10 +1,13 @@
-(function( $ ) {
+define( [
+       "jquery",
+       "ui/progressbar"
+], function( $ ) {
 
 module( "progressbar: methods" );
 
-test( "destroy", function() {
+test( "destroy", function( assert ) {
        expect( 1 );
-       domEqual( "#progressbar", function() {
+       assert.domEqual( "#progressbar", function() {
                $( "#progressbar" ).progressbar().progressbar( "destroy" );
        });
 });
@@ -36,4 +39,4 @@ test( "widget", function() {
        strictEqual( widgetElement[ 0 ], element[ 0 ], "same element" );
 });
 
-}( jQuery ) );
+} );
index 739c97bd9a1f83026e7d5890549850b1e005d8dd..7b6ac9db260a5f35c824f69d015b7e227cdff6b4 100644 (file)
@@ -1,4 +1,7 @@
-(function( $ ) {
+define( [
+       "jquery",
+       "ui/progressbar"
+], function( $ ) {
 
 module( "progressbar: options" );
 
@@ -73,4 +76,4 @@ test( "change max below value", function() {
                "value constrained at max" );
 });
 
-}( jQuery ) );
+} );