From c87653bc24f5bc84c299b047d49a06c132a48788 Mon Sep 17 00:00:00 2001 From: Alyosha Pushak Date: Sun, 12 Apr 2015 19:17:16 -0700 Subject: Accordion: Correct height calculated when closed Fixes #11938 Closes gh-1536 Closes gh-1616 --- tests/unit/accordion/accordion.html | 19 ++++++++++++++++++- tests/unit/accordion/options.js | 16 ++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/unit/accordion/accordion.html b/tests/unit/accordion/accordion.html index 683b87456..ce5856755 100644 --- a/tests/unit/accordion/accordion.html +++ b/tests/unit/accordion/accordion.html @@ -8,12 +8,16 @@ @@ -109,6 +113,19 @@ +
+
+

Header

+
+

+ The calculated height of this accordion should be the same + regardless of whether the accordion was collapsed or not + when the height was calculated. +

+
+
+
+ diff --git a/tests/unit/accordion/options.js b/tests/unit/accordion/options.js index c9b2e3aaf..228a8be40 100644 --- a/tests/unit/accordion/options.js +++ b/tests/unit/accordion/options.js @@ -48,6 +48,22 @@ test( "{ active: false }", function() { strictEqual( element.accordion( "option", "active" ), 0 ); } ); +// http://bugs.jqueryui.com/ticket/11938 +test( "{ active: false, collapsible: true }", function() { + expect( 1 ); + var element = $( "#collapsible" ).accordion(), + height = element.outerHeight(); + + element + .accordion( "destroy" ) + .accordion( { + active: false, + collapsible: true + } ) + .accordion( "option", "active", 0 ); + equal( element.outerHeight(), height ); +} ); + test( "{ active: Number }", function() { expect( 8 ); var element = $( "#list1" ).accordion( { -- cgit v1.2.3