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

tests/unit/widget/widget.html
tests/unit/widget/widget_animation.js
tests/unit/widget/widget_classes.js
tests/unit/widget/widget_core.js
tests/unit/widget/widget_extend.js

index ac106ea32949ec3149b7fa9b0c77d1010167703f..8ccce85255ee96cd4662249e0414331e0cd9617b 100644 (file)
@@ -4,27 +4,15 @@
        <meta charset="utf-8">
        <title>jQuery UI Widget 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" ],
-               js: [
-                       "ui/widget.js"
-               ]
-       });
+       <script src="../../lib/css.js" data-modules="core"></script>
+       <script src="../../lib/bootstrap.js"
+               data-modules="
+                       widget_core
+                       widget_extend
+                       widget_animation
+                       widget_classes
+               ">
        </script>
-
-       <script src="widget_core.js"></script>
-       <script src="widget_extend.js"></script>
-       <script src="widget_animation.js"></script>
-       <script src="widget_classes.js"></script>
-
-       <script src="../swarminject.js"></script>
 </head>
 <body>
 
index 8ef55aa115c2f1d8b18eb7c44f9cccea6d1718b8..4e9d93ccfde1c8282d5092bf699874b9b8910af7 100644 (file)
@@ -1,3 +1,7 @@
+define( [
+       "jquery",
+       "ui/widget"
+], function( $ ) {
 
 module( "widget animation", (function() {
        var show = $.fn.show,
@@ -255,3 +259,5 @@ asyncTest( "show: object(effect)", function() {
                        next();
                });
 });
+
+} );
index 0202d26831c6e104eff1ee92bef547972bb43ef6..1b4a451203070b496a26af51d44761a2146cc322 100644 (file)
@@ -1,4 +1,7 @@
-(function( $ ) {
+define( [
+       "jquery",
+       "ui/widget"
+], function( $ ) {
 
 module( "widget factory classes", {
        setup: function() {
@@ -115,10 +118,10 @@ test( ".option() - classes setter", function( assert ) {
                "Appending a class to the current value works as expected" );
 });
 
-test( ".destroy() - class removal", function() {
+test( ".destroy() - class removal", function( assert ) {
        expect( 1 );
 
-       domEqual( "#widget", function() {
+       assert.domEqual( "#widget", function() {
                $( "#widget" ).classesWidget().classesWidget( "destroy" );
        });
 });
@@ -140,4 +143,4 @@ test( "._add/_remove/_toggleClass()", function( assert ) {
        elementLacksClasses( widget, "remove", assert );
 });
 
-}( jQuery ) );
+} );
index 74d6af9da0a2125bedfeef9d7cd5cdf8cfbfd5e5..22832765bb1ab4100840654a390fff02a5a6768f 100644 (file)
@@ -1,4 +1,8 @@
-(function( $ ) {
+define( [
+       "jquery",
+       "lib/common",
+       "ui/widget"
+], function( $, common ) {
 
 module( "widget factory", {
        teardown: function() {
@@ -9,7 +13,7 @@ module( "widget factory", {
        }
 });
 
-TestHelpers.testJshint( "widget" );
+common.testJshint( "widget" );
 
 test( "widget creation", function() {
        expect( 5 );
@@ -1507,4 +1511,4 @@ test( "$.widget.bridge() - widgetFullName", function() {
        equal( typeof instance, "object", "instance stored in .data(widgetFullName)" );
 });
 
-}( jQuery ) );
+} );
index f5d81bbdc7322e2612b5ea92d7271272b83d9afe..a5a8cccaa8173fd0384bb5092acaa69284e4e9de 100644 (file)
@@ -1,4 +1,7 @@
-(function( $ ) {
+define( [
+       "jquery",
+       "ui/widget"
+], function( $ ) {
 
 test( "$.widget.extend()", function() {
        expect( 27 );
@@ -106,4 +109,4 @@ test( "$.widget.extend()", function() {
        deepEqual( input, output, "don't clone arrays" );
 });
 
-}( jQuery ));
+} );