aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/spinner
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2015-04-06 19:46:15 -0400
committerScott González <scott.gonzalez@gmail.com>2015-04-09 09:26:27 -0400
commit8bda52c8d1d681f3afe5827f8eda10475377442f (patch)
tree2c6d5e310d1741a6224c47e8019859d335062c0c /tests/unit/spinner
parent23a7a113ac61bb12ad6a3775553d5ac1426f82f6 (diff)
downloadjquery-ui-8bda52c8d1d681f3afe5827f8eda10475377442f.tar.gz
jquery-ui-8bda52c8d1d681f3afe5827f8eda10475377442f.zip
Spinner: Convert tests to new infrastructure
Ref #10119 Ref gh-1528
Diffstat (limited to 'tests/unit/spinner')
-rw-r--r--tests/unit/spinner/spinner.html30
-rw-r--r--tests/unit/spinner/spinner_common.js9
-rw-r--r--tests/unit/spinner/spinner_core.js10
-rw-r--r--tests/unit/spinner/spinner_events.js10
-rw-r--r--tests/unit/spinner/spinner_methods.js14
-rw-r--r--tests/unit/spinner/spinner_options.js9
-rw-r--r--tests/unit/spinner/spinner_test_helpers.js6
7 files changed, 45 insertions, 43 deletions
diff --git a/tests/unit/spinner/spinner.html b/tests/unit/spinner/spinner.html
index c427f5de5..43ded34a7 100644
--- a/tests/unit/spinner/spinner.html
+++ b/tests/unit/spinner/spinner.html
@@ -4,34 +4,8 @@
<meta charset="utf-8">
<title>jQuery UI Spinner Test Suite</title>
- <script src="../../jquery.js"></script>
- <script src="../../../external/globalize/globalize.js"></script>
- <script src="../../../external/globalize/globalize.culture.ja-JP.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", "button", "spinner" ],
- js: [
- "ui/core.js",
- "ui/widget.js",
- "ui/button.js",
- "ui/spinner.js"
- ]
- });
- </script>
-
- <script src="spinner_test_helpers.js"></script>
- <script src="spinner_common.js"></script>
- <script src="spinner_core.js"></script>
- <script src="spinner_events.js"></script>
- <script src="spinner_methods.js"></script>
- <script src="spinner_options.js"></script>
-
- <script src="../swarminject.js"></script>
+ <script src="../../lib/css.js" data-modules="core button spinner"></script>
+ <script src="../../lib/bootstrap.js" data-widget="spinner"></script>
</head>
<body>
diff --git a/tests/unit/spinner/spinner_common.js b/tests/unit/spinner/spinner_common.js
index 3eee4f9f0..2c40df76a 100644
--- a/tests/unit/spinner/spinner_common.js
+++ b/tests/unit/spinner/spinner_common.js
@@ -1,4 +1,9 @@
-TestHelpers.commonWidgetTests( "spinner", {
+define( [
+ "lib/common",
+ "ui/spinner"
+], function( common ) {
+
+common.testWidget( "spinner", {
defaults: {
classes: {
"ui-spinner": "ui-corner-all",
@@ -26,3 +31,5 @@ TestHelpers.commonWidgetTests( "spinner", {
stop: null
}
});
+
+} );
diff --git a/tests/unit/spinner/spinner_core.js b/tests/unit/spinner/spinner_core.js
index b3e1e6d23..5faa733c3 100644
--- a/tests/unit/spinner/spinner_core.js
+++ b/tests/unit/spinner/spinner_core.js
@@ -1,6 +1,10 @@
-(function( $ ) {
+define( [
+ "jquery",
+ "./spinner_test_helpers",
+ "ui/spinner"
+], function( $, spinnerTestHelpers ) {
-var simulateKeyDownUp = TestHelpers.spinner.simulateKeyDownUp;
+var simulateKeyDownUp = spinnerTestHelpers.simulateKeyDownUp;
module( "spinner: core" );
@@ -250,4 +254,4 @@ test( "precision", function() {
equal( element.val(), "0.05", "precision from min" );
});
-})( jQuery );
+} );
diff --git a/tests/unit/spinner/spinner_events.js b/tests/unit/spinner/spinner_events.js
index 007d34cf7..05d1efe1b 100644
--- a/tests/unit/spinner/spinner_events.js
+++ b/tests/unit/spinner/spinner_events.js
@@ -1,6 +1,10 @@
-(function( $ ) {
+define( [
+ "jquery",
+ "./spinner_test_helpers",
+ "ui/spinner"
+], function( $, spinnerTestHelpers ) {
-var simulateKeyDownUp = TestHelpers.spinner.simulateKeyDownUp;
+var simulateKeyDownUp = spinnerTestHelpers.simulateKeyDownUp;
module( "spinner: events" );
@@ -256,4 +260,4 @@ asyncTest( "change", function() {
setTimeout( step1 );
});
-})( jQuery );
+} );
diff --git a/tests/unit/spinner/spinner_methods.js b/tests/unit/spinner/spinner_methods.js
index 61ff21d1c..3f88a9e9c 100644
--- a/tests/unit/spinner/spinner_methods.js
+++ b/tests/unit/spinner/spinner_methods.js
@@ -1,12 +1,16 @@
-(function( $ ) {
+define( [
+ "jquery",
+ "./spinner_test_helpers",
+ "ui/spinner"
+], function( $, spinnerTestHelpers ) {
-var simulateKeyDownUp = TestHelpers.spinner.simulateKeyDownUp;
+var simulateKeyDownUp = spinnerTestHelpers.simulateKeyDownUp;
module( "spinner: methods" );
-test( "destroy", function() {
+test( "destroy", function( assert ) {
expect( 1 );
- domEqual( "#spin", function() {
+ assert.domEqual( "#spin", function() {
$( "#spin" ).spinner().spinner( "destroy" );
});
});
@@ -204,4 +208,4 @@ test( "widget", function() {
strictEqual( widgetElement[ 0 ], element.parent()[ 0 ], "parent element" );
});
-})( jQuery );
+} );
diff --git a/tests/unit/spinner/spinner_options.js b/tests/unit/spinner/spinner_options.js
index 160b600c6..f8d9ad396 100644
--- a/tests/unit/spinner/spinner_options.js
+++ b/tests/unit/spinner/spinner_options.js
@@ -1,4 +1,9 @@
-(function( $ ) {
+define( [
+ "jquery",
+ "ui/spinner",
+ "globalize",
+ "globalize/ja-JP"
+], function( $ ) {
module( "spinner: options" );
@@ -263,4 +268,4 @@ test( "step, string", function() {
equal( element.val(), "$0.70", "stepUp" );
});
-})( jQuery );
+} );
diff --git a/tests/unit/spinner/spinner_test_helpers.js b/tests/unit/spinner/spinner_test_helpers.js
index 9b11cf632..9ed904ff4 100644
--- a/tests/unit/spinner/spinner_test_helpers.js
+++ b/tests/unit/spinner/spinner_test_helpers.js
@@ -1,7 +1,11 @@
-TestHelpers.spinner = {
+define( function() {
+
+return {
simulateKeyDownUp: function( element, keyCode, shift ) {
element
.simulate( "keydown", { keyCode: keyCode, shiftKey: shift || false } )
.simulate( "keyup", { keyCode: keyCode, shiftKey: shift || false } );
}
};
+
+} );