diff options
author | Scott González <scott.gonzalez@gmail.com> | 2011-04-04 15:26:32 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2011-04-04 15:26:32 -0400 |
commit | 316d0af8fb05180c72aeb489ab99fdfa6f2f127e (patch) | |
tree | c012c06c6f93e974abc8e973b1e330de84c1dc27 | |
parent | e19d8261c136e6c0b40e08b5bede24467b3dcc0f (diff) | |
download | jquery-ui-316d0af8fb05180c72aeb489ab99fdfa6f2f127e.tar.gz jquery-ui-316d0af8fb05180c72aeb489ab99fdfa6f2f127e.zip |
Accordion: Added test to ensure activate event is not triggered if beforeActive is prevented.
-rw-r--r-- | tests/unit/accordion/accordion_events.js | 12 |
1 files changed, 11 insertions, 1 deletions
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 ) ); |