<meta charset="utf-8">
<title>jQuery UI Slider 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", "slider" ],
- js: [
- "ui/core.js",
- "ui/widget.js",
- "ui/mouse.js",
- "ui/slider.js"
- ]
- });
- </script>
-
- <script src="slider_common.js"></script>
- <script src="slider_core.js"></script>
- <script src="slider_events.js"></script>
- <script src="slider_methods.js"></script>
- <script src="slider_options.js"></script>
-
- <script src="../swarminject.js"></script>
+ <script src="../../lib/css.js" data-modules="core slider"></script>
+ <script src="../../lib/bootstrap.js" data-widget="slider"></script>
</head>
<body>
-TestHelpers.commonWidgetTests( "slider", {
+define( [
+ "lib/common",
+ "ui/slider"
+], function( common ) {
+
+common.testWidget( "slider", {
defaults: {
animate: false,
cancel: "input, textarea, button, select, option",
stop: null
}
});
+
+} );
-(function( $ ) {
-//
-// Slider Test Helper Functions
-//
+define( [
+ "jquery",
+ "ui/slider"
+], function( $ ) {
var element, options;
element.slider( "destroy" );
});
-})( jQuery );
+} );
-(function( $ ) {
+define( [
+ "jquery",
+ "ui/slider"
+], function( $ ) {
module( "slider: events" );
handles.eq( slideHandleIndex ).simulate( "drag", { dx: 10 } );
});
-})( jQuery );
+} );
-(function( $ ) {
+define( [
+ "jquery",
+ "ui/slider"
+], function( $ ) {
module( "slider: methods" );
ok( true, "arbitrary option setter after init" );
});
-test( "destroy", function() {
+test( "destroy", function( assert ) {
expect( 1 );
- domEqual( "#slider1", function() {
+ assert.domEqual( "#slider1", function() {
$( "#slider1" ).slider().slider( "destroy" );
});
});
// ok(false, "missing test - untested code is broken code." );
//});
-})( jQuery );
+} );
-(function( $ ) {
+define( [
+ "jquery",
+ "ui/slider"
+], function( $ ) {
var element, options;
element.slider( options );
ok( element.slider( "option", "value" ) === options.value, "value option is not contained by max" );
ok( element.slider( "value" ) === options.max, "value method is contained by max" );
-
+
options = {
max: 9,
min: 1,
element.slider( options );
ok( element.slider( "value" ) === 7, "value method is within max, edge Case" );
-
+
options.step = 2;
element.slider( options );
element.slider( "destroy" );
});
-})( jQuery );
+} );