aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/accordion/accordion_options.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/accordion/accordion_options.js')
-rw-r--r--tests/unit/accordion/accordion_options.js31
1 files changed, 11 insertions, 20 deletions
diff --git a/tests/unit/accordion/accordion_options.js b/tests/unit/accordion/accordion_options.js
index e46795993..31aabc0d1 100644
--- a/tests/unit/accordion/accordion_options.js
+++ b/tests/unit/accordion/accordion_options.js
@@ -66,17 +66,18 @@ test("{ active: Number }", function() {
});
test("{ autoHeight: true }, default", function() {
- $('#navigation').accordion({ autoHeight: true });
- equals( $('#navigation > li:eq(0) > ul').height(), 126 );
- equals( $('#navigation > li:eq(1) > ul').height(), 126 );
- equals( $('#navigation > li:eq(2) > ul').height(), 126 );
+ equalHeights($('#navigation').accordion({ autoHeight: true }), 95, 130);
});
test("{ autoHeight: false }", function() {
- $('#navigation').accordion({ autoHeight: false });
- equals( $('#navigation > li:eq(0) > ul').height(), 90 );
- equals( $('#navigation > li:eq(1) > ul').height(), 126 );
- equals( $('#navigation > li:eq(2) > ul').height(), 54 );
+ var accordion = $('#navigation').accordion({ autoHeight: false });
+ var sizes = [];
+ accordion.find(".ui-accordion-content").each(function() {
+ sizes.push($(this).outerHeight());
+ });
+ ok( sizes[0] >= 70 && sizes[0] <= 90 );
+ ok( sizes[1] >= 98 && sizes[1] <= 126 );
+ ok( sizes[2] >= 54 && sizes[2] <= 54 );
});
test("{ collapsible: false }, default", function() {
@@ -95,20 +96,10 @@ test("{ collapsible: true }", function() {
state(ac, 0, 0, 0);
});
-test("{ fillSpace: false }, default", function() {
- $("#navigationWrapper").height(500);
- $('#navigation').accordion({ fillSpace: false });
- equals( $('#navigation > li:eq(0) > ul').height(), 126 );
- equals( $('#navigation > li:eq(1) > ul').height(), 126 );
- equals( $('#navigation > li:eq(2) > ul').height(), 126 );
-});
-
+// fillSpace: false == autoHeight: true, covered above
test("{ fillSpace: true }", function() {
$("#navigationWrapper").height(500);
- $('#navigation').accordion({ fillSpace: true });
- equals( $('#navigation > li:eq(0) > ul').height(), 446 );
- equals( $('#navigation > li:eq(1) > ul').height(), 446 );
- equals( $('#navigation > li:eq(2) > ul').height(), 446 );
+ equalHeights($('#navigation').accordion({ fillSpace: true }), 446, 458);
});
test("{ header: '> li > :first-child,> :not(li):even' }, default", function() {