]> source.dussan.org Git - jquery-ui.git/commitdiff
Slider unit tests: slider event change
authorRichard Worth <rdworth@gmail.com>
Wed, 17 Mar 2010 15:58:22 +0000 (15:58 +0000)
committerRichard Worth <rdworth@gmail.com>
Wed, 17 Mar 2010 15:58:22 +0000 (15:58 +0000)
tests/unit/slider/slider_events.js

index a3d6c528216e94dc2909c3d992edd7aad3e0a510..dd68a74b6d8020d66c0143ce49eae2b8009e4e4d 100644 (file)
@@ -20,7 +20,7 @@ test( "slide", function() {
 // value (even if same as previous value), via mouse(mouseup) or keyboard(keyup)
 // or value method/option"
 test( "change", function() {
-       expect(4);
+       expect(7);
        
        var handle;
        // Test mouseup at end of handle slide (mouse)
@@ -60,6 +60,17 @@ test( "change", function() {
                })
                .slider( "value", 0 );
 
+       reset();
+       // Test values method
+       el = $( "<div></div>" )
+               .slider({
+                       values: [ 10, 20 ],
+                       change: function(event, ui) {
+                               ok( true, "change triggered by values method" );
+                       }
+               })
+               .slider( "values", [80, 90] );
+
        reset();
        // Test value option
        el = $( "<div></div>" )
@@ -70,6 +81,17 @@ test( "change", function() {
                })
                .slider( "option", "value", 0 );
 
+       reset();
+       // Test values option
+       el = $( "<div></div>" )
+               .slider({
+                       values: [ 10, 20 ],
+                       change: function(event, ui) {
+                               ok( true, "change triggered by values option" );
+                       }
+               })
+               .slider( "option", "values", [80, 90] );
+
 });
 
 test( "stop", function() {