]> source.dussan.org Git - jquery-ui.git/commitdiff
Accordion: Added test to ensure activate event is not triggered if beforeActive is...
authorScott González <scott.gonzalez@gmail.com>
Mon, 4 Apr 2011 19:26:32 +0000 (15:26 -0400)
committerScott González <scott.gonzalez@gmail.com>
Mon, 4 Apr 2011 19:26:32 +0000 (15:26 -0400)
tests/unit/accordion/accordion_events.js

index 161da25bfa6d19e0306f1a46407473c60d1ec45f..c3ba2e2c1b6cbf28f0cda0b2f5a3960b0ab88f38 100644 (file)
@@ -68,7 +68,7 @@ test( "beforeActivate", function() {
 });
 
 test( "activate", function() {
-       expect( 20 );
+       expect( 21 );
        var ac = $( "#list1" ).accordion({
                active: false,
                collapsible: true
@@ -107,6 +107,16 @@ test( "activate", function() {
                equals( ui.newContent.size(), 0 );
        });
        ac.accordion( "option", "active", false );
+
+       // prevent activation
+       ac.one( "accordionbeforeactivate", function( event ) {
+               ok( true );
+               event.preventDefault();
+       });
+       ac.one( "accordionactivate", function() {
+               ok( false );
+       });
+       ac.accordion( "option", "active", 1 );
 });
 
 }( jQuery ) );