]> source.dussan.org Git - jquery-ui.git/commitdiff
Selectable: Convert tests to new infrastructure
authorScott González <scott.gonzalez@gmail.com>
Mon, 6 Apr 2015 18:38:11 +0000 (14:38 -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/selectable/selectable.html
tests/unit/selectable/selectable_common.js
tests/unit/selectable/selectable_events.js
tests/unit/selectable/selectable_methods.js
tests/unit/selectable/selectable_options.js

index 024d2891178a738a2f05e67fd09ae315790b8689..4486084e4bab93b3f8982f1f66f9f52f679c179f 100644 (file)
@@ -4,31 +4,8 @@
        <meta charset="utf-8">
        <title>jQuery UI Selectable 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", "selectable" ],
-               js: [
-                       "ui/core.js",
-                       "ui/widget.js",
-                       "ui/mouse.js",
-                       "ui/selectable.js"
-               ]
-       });
-       </script>
-
-       <script src="selectable_common.js"></script>
-       <script src="selectable_core.js"></script>
-       <script src="selectable_events.js"></script>
-       <script src="selectable_methods.js"></script>
-       <script src="selectable_options.js"></script>
-
-       <script src="../swarminject.js"></script>
+       <script src="../../lib/css.js" data-modules="core selectable"></script>
+       <script src="../../lib/bootstrap.js" data-widget="selectable"></script>
 </head>
 <body>
 
index 79bf6e3c5dc3d96b7ed6bd9fbedeb307fd2a1f97..9a14e6df57cfe15c852abead678aed75a8a29881 100644 (file)
@@ -1,4 +1,9 @@
-TestHelpers.commonWidgetTests("selectable", {
+define( [
+       "lib/common",
+       "ui/selectable"
+], function( common ) {
+
+common.testWidget( "selectable", {
        defaults: {
                appendTo: "body",
                autoRefresh: true,
@@ -20,3 +25,5 @@ TestHelpers.commonWidgetTests("selectable", {
                unselecting: null
        }
 });
+
+} );
index 5df7f2f5b25aa16d366c9b8aefa89d5110176a85..6eb99f32535543e28f33dc9279dafcaf5487a4a7 100644 (file)
@@ -1,7 +1,8 @@
-/*
- * selectable_events.js
- */
-(function( $ ) {
+define( [
+       "jquery",
+       "lib/helper",
+       "ui/selectable"
+], function( $, testHelpers ) {
 
 module("selectable: events");
 
@@ -40,7 +41,7 @@ test( "mousedown: initial position of helper", function() {
 
        var helperOffset,
                element = $( "#selectable1" ).selectable(),
-               contentToForceScroll = TestHelpers.forceScrollableWindow( "body" );
+               contentToForceScroll = testHelpers.forceScrollableWindow( "body" );
 
        $( window ).scrollTop( 100 ).scrollLeft( 100 );
 
@@ -59,4 +60,4 @@ test( "mousedown: initial position of helper", function() {
        $( window ).scrollTop( 0 ).scrollLeft( 0 );
 });
 
-})( jQuery );
+} );
index 02c9ab0752e1a2b5894eb82fb27df60f8cfd5f86..045809670dcaa416be13458cb140039dccd080e8 100644 (file)
@@ -1,7 +1,7 @@
-/*
- * selectable_methods.js
- */
-(function($) {
+define( [
+       "jquery",
+       "ui/selectable"
+], function( $ ) {
 
 module("selectable: methods");
 
@@ -108,4 +108,4 @@ test( "disable", function( assert ) {
        equal( chainable, element, "disable is chainable" );
 });
 
-})(jQuery);
+} );
index 292c0cf960b9f441a30c586ddb78fc7ff5ba3d65..cdbfb4aab2cac40e01bd407712fa7bb4ad68236e 100644 (file)
@@ -1,7 +1,7 @@
-/*
- * selectable_options.js
- */
-(function($) {
+define( [
+       "jquery",
+       "ui/selectable"
+], function( $ ) {
 
 module("selectable: options");
 
@@ -61,4 +61,4 @@ test("filter", function() {
        el.selectable("destroy");
 });
 
-})(jQuery);
+} );