diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-01-31 11:46:31 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-01-31 11:46:31 -0500 |
commit | 3919256abd7b91dcc8437c245f98d623103f97e0 (patch) | |
tree | e9c65fa29c35e9a5f97a5f85a80858cc30d46ba7 /tests/unit | |
parent | ecddf469d7924d88d72e57a4806996fc50fa50ae (diff) | |
download | jquery-ui-3919256abd7b91dcc8437c245f98d623103f97e0.tar.gz jquery-ui-3919256abd7b91dcc8437c245f98d623103f97e0.zip |
Accordion: Pass header and content in create event. Fixes #7869 - Accordion: Provide header and content details in create event.
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/accordion/accordion_events.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/unit/accordion/accordion_events.js b/tests/unit/accordion/accordion_events.js index 12acf2a44..b5c3ea228 100644 --- a/tests/unit/accordion/accordion_events.js +++ b/tests/unit/accordion/accordion_events.js @@ -2,6 +2,45 @@ module( "accordion: events", accordion_setupTeardown() ); +test( "create", function() { + expect( 10 ); + + var element = $( "#list1" ), + headers = element.children( "h3" ), + contents = headers.next(); + + element.accordion({ + create: function( event, ui ) { + equals( ui.header.size(), 1, "header size" ); + strictEqual( ui.header[ 0 ], headers[ 0 ], "header" ); + equals( ui.content.size(), 1, "content size" ); + strictEqual( ui.content[ 0 ], contents[ 0 ], "content" ); + } + }); + element.accordion( "destroy" ); + + element.accordion({ + active: 2, + create: function( event, ui ) { + equals( ui.header.size(), 1, "header size" ); + strictEqual( ui.header[ 0 ], headers[ 2 ], "header" ); + equals( ui.content.size(), 1, "content size" ); + strictEqual( ui.content[ 0 ], contents[ 2 ], "content" ); + } + }); + element.accordion( "destroy" ); + + element.accordion({ + active: false, + collapsible: true, + create: function( event, ui ) { + equals( ui.header.size(), 0, "header size" ); + equals( ui.content.size(), 0, "content size" ); + } + }); + element.accordion( "destroy" ); +}); + test( "beforeActivate", function() { expect( 38 ); var element = $( "#list1" ).accordion({ |