aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/accordion/accordion_core.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2009-09-15 08:33:28 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2009-09-15 08:33:28 +0000
commitb9b604936e29c3d6a5a50f75460eb3c98ee80f30 (patch)
treef4b8d05dc0c0f2e29ad5e3a3f29663e5fadd70d9 /tests/unit/accordion/accordion_core.js
parenta282bba6cdb63f2565562e358c93b9643ff09b54 (diff)
downloadjquery-ui-b9b604936e29c3d6a5a50f75460eb3c98ee80f30.tar.gz
jquery-ui-b9b604936e29c3d6a5a50f75460eb3c98ee80f30.zip
accordion: remove deprecated alwaysOpen option (collapsible was introduced in last stable release); fixed collapsible-false accordion in combination with activate method (with fasly-argument to close all); changed activate-option default to 0 (which was the "computed" default anyway); lots of fixes for the testsuite, while removing some of the "missing" tests: header accepts only a selector (updated spec to make that more clear), while testing animations in unit tests is rather pointless
Diffstat (limited to 'tests/unit/accordion/accordion_core.js')
-rw-r--r--tests/unit/accordion/accordion_core.js24
1 files changed, 8 insertions, 16 deletions
diff --git a/tests/unit/accordion/accordion_core.js b/tests/unit/accordion/accordion_core.js
index 524842037..797ead864 100644
--- a/tests/unit/accordion/accordion_core.js
+++ b/tests/unit/accordion/accordion_core.js
@@ -2,34 +2,26 @@
* accordion_core.js
*/
+
+(function($) {
+
jQuery.ui.accordion.defaults.animated = false;
function state(accordion) {
var args = $.makeArray(arguments).slice(1);
+ var result = [];
$.each(args, function(i, n) {
- equals(accordion.find(".ui-accordion-content").eq(i).is(":visible"), n);
+ result.push( accordion.find(".ui-accordion-content").eq(i).is(":visible") ? 1 : 0 );
});
+ same(args, result)
}
-function state2(accordion) {
- var args = $.makeArray(arguments).slice(1);
- $.each(args, function(i, n) {
- equals(accordion.find("div").eq(i).is(":visible"), n);
- });
-}
-
-$.fn.triggerEvent = function(type, target) {
- return this.triggerHandler(type, [jQuery.event.fix({ type: type, target: target })]);
-};
-
-(function($) {
-
module("accordion: core");
test("handle click on header-descendant", function() {
var ac = $('#navigation').accordion({ autoHeight: false });
- ac.triggerEvent("click", $('#navigation span:contains(Bass)')[0]);
- state2(ac, 0, 1, 0);
+ $('#navigation h2:eq(1) a').trigger("click");
+ state(ac, 0, 1, 0);
});
test("accessibility", function () {