diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2008-07-13 14:42:27 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2008-07-13 14:42:27 +0000 |
commit | 30952e6b3f80da814e6d7ff633fc1eac0b3c4a13 (patch) | |
tree | 554f65d64b9ac4cb10e9f18217f91199b009f72a /tests | |
parent | d1b099907d1c3425dbae70d573103dca160e98b9 (diff) | |
download | jquery-ui-30952e6b3f80da814e6d7ff633fc1eac0b3c4a13.tar.gz jquery-ui-30952e6b3f80da814e6d7ff633fc1eac0b3c4a13.zip |
accordion: fixed incosistent accordionchange event arguments (http://dev.jquery.com/ticket/3111)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/accordion.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/accordion.js b/tests/accordion.js index e957acd43..ff3719b41 100644 --- a/tests/accordion.js +++ b/tests/accordion.js @@ -99,4 +99,34 @@ test("handle click on header-descendant", function() { state2(ac, 0, 1, 0); }); +test("active:false", function() { + $("#list1").accordion({ + active: false, + alwaysOpen: false + }); + equals( $("#list1 a.selected").size(), 0, "no headers selected" ); +}); + +test("accordionchange event, open closed and close again", function() { + expect(8); + $("#list1").accordion({ + active: false, + alwaysOpen: false + }) + .one("accordionchange", function(event, ui) { + equals( ui.oldHeader.size(), 0 ) + equals( ui.oldContent.size(), 0 ) + equals( ui.newHeader.size(), 1 ) + equals( ui.newContent.size(), 1 ) + }) + .accordion("activate", 0) + .one("accordionchange", function(event, ui) { + equals( ui.oldHeader.size(), 1 ) + equals( ui.oldContent.size(), 1 ) + equals( ui.newHeader.size(), 0 ) + equals( ui.newContent.size(), 0 ) + }) + .accordion("activate", 0); +}); + })(jQuery); |