Widget: Convert tests to new infrastructure

Ref #10119
Ref gh-1528
This commit is contained in:
Scott González 2015-04-06 15:07:04 -04:00
parent 94f5c15df9
commit 23a7a113ac
5 changed files with 33 additions and 29 deletions

View File

@ -4,27 +4,15 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>jQuery UI Widget Test Suite</title> <title>jQuery UI Widget Test Suite</title>
<script src="../../jquery.js"></script> <script src="../../lib/css.js" data-modules="core"></script>
<link rel="stylesheet" href="../../../external/qunit/qunit.css"> <script src="../../lib/bootstrap.js"
<script src="../../../external/qunit/qunit.js"></script> data-modules="
<script src="../../../external/jquery-simulate/jquery.simulate.js"></script> widget_core
<script src="../testsuite.js"></script> widget_extend
<script src="../../../external/qunit-assert-classes/qunit-assert-classes.js"></script> widget_animation
<script> widget_classes
TestHelpers.loadResources({ ">
css: [ "core" ],
js: [
"ui/widget.js"
]
});
</script> </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> </head>
<body> <body>

View File

@ -1,3 +1,7 @@
define( [
"jquery",
"ui/widget"
], function( $ ) {
module( "widget animation", (function() { module( "widget animation", (function() {
var show = $.fn.show, var show = $.fn.show,
@ -255,3 +259,5 @@ asyncTest( "show: object(effect)", function() {
next(); next();
}); });
}); });
} );

View File

@ -1,4 +1,7 @@
(function( $ ) { define( [
"jquery",
"ui/widget"
], function( $ ) {
module( "widget factory classes", { module( "widget factory classes", {
setup: function() { setup: function() {
@ -115,10 +118,10 @@ test( ".option() - classes setter", function( assert ) {
"Appending a class to the current value works as expected" ); "Appending a class to the current value works as expected" );
}); });
test( ".destroy() - class removal", function() { test( ".destroy() - class removal", function( assert ) {
expect( 1 ); expect( 1 );
domEqual( "#widget", function() { assert.domEqual( "#widget", function() {
$( "#widget" ).classesWidget().classesWidget( "destroy" ); $( "#widget" ).classesWidget().classesWidget( "destroy" );
}); });
}); });
@ -140,4 +143,4 @@ test( "._add/_remove/_toggleClass()", function( assert ) {
elementLacksClasses( widget, "remove", assert ); elementLacksClasses( widget, "remove", assert );
}); });
}( jQuery ) ); } );

View File

@ -1,4 +1,8 @@
(function( $ ) { define( [
"jquery",
"lib/common",
"ui/widget"
], function( $, common ) {
module( "widget factory", { module( "widget factory", {
teardown: function() { teardown: function() {
@ -9,7 +13,7 @@ module( "widget factory", {
} }
}); });
TestHelpers.testJshint( "widget" ); common.testJshint( "widget" );
test( "widget creation", function() { test( "widget creation", function() {
expect( 5 ); expect( 5 );
@ -1507,4 +1511,4 @@ test( "$.widget.bridge() - widgetFullName", function() {
equal( typeof instance, "object", "instance stored in .data(widgetFullName)" ); equal( typeof instance, "object", "instance stored in .data(widgetFullName)" );
}); });
}( jQuery ) ); } );

View File

@ -1,4 +1,7 @@
(function( $ ) { define( [
"jquery",
"ui/widget"
], function( $ ) {
test( "$.widget.extend()", function() { test( "$.widget.extend()", function() {
expect( 27 ); expect( 27 );
@ -106,4 +109,4 @@ test( "$.widget.extend()", function() {
deepEqual( input, output, "don't clone arrays" ); deepEqual( input, output, "don't clone arrays" );
}); });
}( jQuery )); } );