From: Scott González Date: Mon, 4 Apr 2011 19:26:32 +0000 (-0400) Subject: Accordion: Added test to ensure activate event is not triggered if beforeActive is... X-Git-Tag: 1.9m5~143 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=316d0af8fb05180c72aeb489ab99fdfa6f2f127e;p=jquery-ui.git Accordion: Added test to ensure activate event is not triggered if beforeActive is prevented. --- diff --git a/tests/unit/accordion/accordion_events.js b/tests/unit/accordion/accordion_events.js index 161da25bf..c3ba2e2c1 100644 --- a/tests/unit/accordion/accordion_events.js +++ b/tests/unit/accordion/accordion_events.js @@ -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 ) );