Skip to content
Permalink
Browse files

Slider: Convert tests to new infrastructure

Ref #10119
Ref gh-1528
  • Loading branch information...
scottgonzalez committed Apr 6, 2015
1 parent 3522fd9 commit a856dd9b7e00982cbe4dc9a2dce8ca940728126d
@@ -4,31 +4,8 @@
<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>

@@ -1,4 +1,9 @@
TestHelpers.commonWidgetTests( "slider", {
define( [
"lib/common",
"ui/slider"
], function( common ) {

common.testWidget( "slider", {
defaults: {
animate: false,
cancel: "input, textarea, button, select, option",
@@ -26,3 +31,5 @@ TestHelpers.commonWidgetTests( "slider", {
stop: null
}
});

} );
@@ -1,7 +1,7 @@
(function( $ ) {
//
// Slider Test Helper Functions
//
define( [
"jquery",
"ui/slider"
], function( $ ) {

var element, options;

@@ -306,4 +306,4 @@ test( "keydown LEFT on handle decreases value by step, not less than min", funct
element.slider( "destroy" );
});

})( jQuery );
} );
@@ -1,4 +1,7 @@
(function( $ ) {
define( [
"jquery",
"ui/slider"
], function( $ ) {

module( "slider: events" );

@@ -202,4 +205,4 @@ test( "event data", function() {
handles.eq( slideHandleIndex ).simulate( "drag", { dx: 10 } );
});

})( jQuery );
} );
@@ -1,4 +1,7 @@
(function( $ ) {
define( [
"jquery",
"ui/slider"
], function( $ ) {

module( "slider: methods" );

@@ -23,9 +26,9 @@ test( "init", function() {
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" );
});
});
@@ -110,4 +113,4 @@ test( "value", function() {
// ok(false, "missing test - untested code is broken code." );
//});

})( jQuery );
} );
@@ -1,4 +1,7 @@
(function( $ ) {
define( [
"jquery",
"ui/slider"
], function( $ ) {

var element, options;

@@ -54,7 +57,7 @@ test( "max", function() {
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,
@@ -65,7 +68,7 @@ test( "max", function() {

element.slider( options );
ok( element.slider( "value" ) === 7, "value method is within max, edge Case" );

options.step = 2;

element.slider( options );
@@ -343,4 +346,4 @@ test( "range", function( assert ) {
element.slider( "destroy" );
});

})( jQuery );
} );

0 comments on commit a856dd9

Please sign in to comment.
You can’t perform that action at this time.