Skip to content
Permalink
Browse files

Accordion: Added test to ensure activate event is not triggered if be…

…foreActive is prevented.
  • Loading branch information
scottgonzalez committed Apr 4, 2011
1 parent e19d826 commit 316d0af8fb05180c72aeb489ab99fdfa6f2f127e
Showing with 11 additions and 1 deletion.
  1. +11 −1 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 ) );

0 comments on commit 316d0af

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