aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2015-04-06 15:07:04 -0400
committerScott González <scott.gonzalez@gmail.com>2015-04-09 09:26:27 -0400
commit23a7a113ac61bb12ad6a3775553d5ac1426f82f6 (patch)
tree133d0d9b4d73f43e77c40f51e13efc4439b38c0c /tests/unit
parent94f5c15df97ca975f039788f6220650492d924be (diff)
downloadjquery-ui-23a7a113ac61bb12ad6a3775553d5ac1426f82f6.tar.gz
jquery-ui-23a7a113ac61bb12ad6a3775553d5ac1426f82f6.zip
Widget: Convert tests to new infrastructure
Ref #10119 Ref gh-1528
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/widget/widget.html28
-rw-r--r--tests/unit/widget/widget_animation.js6
-rw-r--r--tests/unit/widget/widget_classes.js11
-rw-r--r--tests/unit/widget/widget_core.js10
-rw-r--r--tests/unit/widget/widget_extend.js7
5 files changed, 33 insertions, 29 deletions
diff --git a/tests/unit/widget/widget.html b/tests/unit/widget/widget.html
index ac106ea32..8ccce8525 100644
--- a/tests/unit/widget/widget.html
+++ b/tests/unit/widget/widget.html
@@ -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>
diff --git a/tests/unit/widget/widget_animation.js b/tests/unit/widget/widget_animation.js
index 8ef55aa11..4e9d93ccf 100644
--- a/tests/unit/widget/widget_animation.js
+++ b/tests/unit/widget/widget_animation.js
@@ -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();
});
});
+
+} );
diff --git a/tests/unit/widget/widget_classes.js b/tests/unit/widget/widget_classes.js
index 0202d2683..1b4a45120 100644
--- a/tests/unit/widget/widget_classes.js
+++ b/tests/unit/widget/widget_classes.js
@@ -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 ) );
+} );
diff --git a/tests/unit/widget/widget_core.js b/tests/unit/widget/widget_core.js
index 74d6af9da..22832765b 100644
--- a/tests/unit/widget/widget_core.js
+++ b/tests/unit/widget/widget_core.js
@@ -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 ) );
+} );
diff --git a/tests/unit/widget/widget_extend.js b/tests/unit/widget/widget_extend.js
index f5d81bbdc..a5a8cccaa 100644
--- a/tests/unit/widget/widget_extend.js
+++ b/tests/unit/widget/widget_extend.js
@@ -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 ));
+} );