Skip to content

Commit 9b720f8

Browse files
committed
Accordion: unit test for collapsed height
1 parent 693c9a5 commit 9b720f8

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

tests/unit/accordion/accordion.html

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,16 @@
88
<script src="../../lib/css.js" data-modules="core accordion"></script>
99
<script src="../../lib/bootstrap.js" data-widget="accordion"></script>
1010
<style>
11-
#list, #list1 *, #navigation, #navigation * {
11+
#list, #list1 *, #navigation, #navigation *, #collapsible, #collapsible * {
1212
margin: 0;
1313
padding: 0;
1414
font-size: 12px;
1515
line-height: 15px;
1616
}
17+
#collapsibleWrapper {
18+
width: 300px;
19+
float: left;
20+
}
1721
</style>
1822
</head>
1923
<body>
@@ -109,6 +113,19 @@ <h2><a href="?p=1.1.3">Drums</a></h2>
109113
</dd>
110114
</dl>
111115

116+
<div id="collapsibleWrapper">
117+
<div id="collapsible">
118+
<h3>Header</h3>
119+
<div>
120+
<p>
121+
The calculated height of this accordion should be the same
122+
regardless of whether the accordion was collapsed or not
123+
when the height was calculated.
124+
</p>
125+
</div>
126+
</div>
127+
</div>
128+
112129
</div>
113130
</body>
114131
</html>

tests/unit/accordion/methods.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ var equalHeight = testHelper.equalHeight,
1010

1111
module( "accordion: methods", setupTeardown() );
1212

13+
test( "collapsedHeight", function() {
14+
expect( 1 );
15+
var element = $( "#collapsible" ).accordion(),
16+
content = element.find( ".ui-accordion-content" ),
17+
height = content.height();
18+
element.accordion( "destroy" ).accordion({
19+
active: false,
20+
collapsible: true
21+
});
22+
equal( content.height(), height );
23+
});
24+
1325
test( "destroy", function( assert ) {
1426
expect( 1 );
1527
assert.domEqual( "#list1", function() {

0 commit comments

Comments
 (0)