window.requirejs = {
paths: {
+ "globalize": "../../../external/globalize/globalize",
+ "globalize/ja-JP": "../../../external/globalize/globalize.culture.ja-JP",
"jquery": jqueryUrl(),
"jquery-simulate": "../../../external/jquery-simulate/jquery.simulate",
"jshint": "../../../external/jshint/jshint",
"ui": "../../../ui"
},
shim: {
+ "globalize/ja-JP": [ "globalize" ],
"jquery-simulate": [ "jquery" ],
"qunit-assert-classes": [ "qunit" ]
}
<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>
-TestHelpers.commonWidgetTests( "spinner", {
+define( [
+ "lib/common",
+ "ui/spinner"
+], function( common ) {
+
+common.testWidget( "spinner", {
defaults: {
classes: {
"ui-spinner": "ui-corner-all",
stop: null
}
});
+
+} );
-(function( $ ) {
+define( [
+ "jquery",
+ "./spinner_test_helpers",
+ "ui/spinner"
+], function( $, spinnerTestHelpers ) {
-var simulateKeyDownUp = TestHelpers.spinner.simulateKeyDownUp;
+var simulateKeyDownUp = spinnerTestHelpers.simulateKeyDownUp;
module( "spinner: core" );
equal( element.val(), "0.05", "precision from min" );
});
-})( jQuery );
+} );
-(function( $ ) {
+define( [
+ "jquery",
+ "./spinner_test_helpers",
+ "ui/spinner"
+], function( $, spinnerTestHelpers ) {
-var simulateKeyDownUp = TestHelpers.spinner.simulateKeyDownUp;
+var simulateKeyDownUp = spinnerTestHelpers.simulateKeyDownUp;
module( "spinner: events" );
setTimeout( step1 );
});
-})( jQuery );
+} );
-(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" );
});
});
strictEqual( widgetElement[ 0 ], element.parent()[ 0 ], "parent element" );
});
-})( jQuery );
+} );
-(function( $ ) {
+define( [
+ "jquery",
+ "ui/spinner",
+ "globalize",
+ "globalize/ja-JP"
+], function( $ ) {
module( "spinner: options" );
equal( element.val(), "$0.70", "stepUp" );
});
-})( jQuery );
+} );
-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 } );
}
};
+
+} );