diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2009-07-03 21:05:22 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2009-07-03 21:05:22 +0000 |
commit | b6bdbb421177660c9f36cfbdb66430406f615427 (patch) | |
tree | 9820b98867a6844b352783692e38a1bd47755f74 /tests/unit/accordion | |
parent | cfe9a275c91124803f24417a97a1b4b8f6abaab5 (diff) | |
download | jquery-ui-b6bdbb421177660c9f36cfbdb66430406f615427.tar.gz jquery-ui-b6bdbb421177660c9f36cfbdb66430406f615427.zip |
accordion fix for #4653: added tests, adopted no-auto-height demo to also cover navigation option; fixed an unrelated bug, where ui-accordion-content-active was never removed
Diffstat (limited to 'tests/unit/accordion')
-rw-r--r-- | tests/unit/accordion/accordion.html | 6 | ||||
-rw-r--r-- | tests/unit/accordion/accordion_options.js | 24 |
2 files changed, 19 insertions, 11 deletions
diff --git a/tests/unit/accordion/accordion.html b/tests/unit/accordion/accordion.html index bce2e8cd7..fbb3a85d0 100644 --- a/tests/unit/accordion/accordion.html +++ b/tests/unit/accordion/accordion.html @@ -58,7 +58,7 @@ <ul id="navigation"> <li> - <a href="?p=1.1.1">Guitar</a> + <h2><a href="?p=1.1.1">Guitar</a></h2> <ul> <li><a href="?p=1.1.1.1">Electric</a></li> <li><a href="?p=1.1.1.2">Acoustic</a></li> @@ -68,7 +68,7 @@ </ul> </li> <li> - <a href="?p=1.1.2"><span>Bass</span></a> + <h2><a href="?p=1.1.2"><span>Bass</span></a></h2> <ul> <li><a href="?p=1.1.2.1">Electric</a></li> <li><a href="?p=1.1.2.2">Acoustic</a></li> @@ -80,7 +80,7 @@ </ul> </li> <li> - <a href="?p=1.1.3">Drums</a> + <h2><a href="?p=1.1.3">Drums</a></h2> <ul> <li><a href="?p=1.1.3.2">Acoustic Drums</a></li> <li><a href="?p=1.1.3.3">Electronic Drums</a></li> diff --git a/tests/unit/accordion/accordion_options.js b/tests/unit/accordion/accordion_options.js index 1ef6542a3..95edae597 100644 --- a/tests/unit/accordion/accordion_options.js +++ b/tests/unit/accordion/accordion_options.js @@ -136,16 +136,24 @@ test("{ icons: false }", function() { icons(false); }); -test("{ navigation: false }, default", function() { - ok(false, 'missing test - untested code is broken code'); -}); - -test("{ navigation: true }", function() { - ok(false, 'missing test - untested code is broken code'); +test("{ navigation: true, navigationFilter: header }", function() { + $("#navigation").accordion({ + navigation: true, + navigationFilter: function() { + return /\?p=1\.1\.3$/.test(this.href); + } + }); + equals( $("#navigation .ui-accordion-content:eq(2)").size(), 1, "third content active" ); }); -test("{ navigationFilter: Function }, default", function() { - ok(false, 'missing test - untested code is broken code'); +test("{ navigation: true, navigationFilter: content }", function() { + $("#navigation").accordion({ + navigation: true, + navigationFilter: function() { + return /\?p=1\.1\.3\.2$/.test(this.href); + } + }); + equals( $("#navigation .ui-accordion-content:eq(2)").size(), 1, "third content active" ); }); })(jQuery); |