Skip to content

Commit

Permalink
Accordion: unit test for collapsed height
Browse files Browse the repository at this point in the history
  • Loading branch information
apushak committed Apr 23, 2015
1 parent fe1aba3 commit 5fa27f3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/unit/accordion/accordion.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
<script src="../../lib/css.js" data-modules="core accordion"></script>
<script src="../../lib/bootstrap.js" data-widget="accordion"></script>
<style>
#list, #list1 *, #navigation, #navigation * {
#list, #list1 *, #navigation, #navigation *, #collapsible, #collapsible * {
margin: 0;
padding: 0;
font-size: 12px;
line-height: 15px;
}
#collapsibleWrapper {
width: 300px;
float: left;
}
</style>
</head>
<body>
Expand Down Expand Up @@ -108,6 +112,19 @@ <h2><a href="?p=1.1.3">Drums</a></h2>
</dd>
</dl>

<div id="collapsibleWrapper">
<div id="collapsible">
<h3>Header</h3>
<div>
<p>
The calculated height of this accordion should be the same
regardless of whether the accordion was collapsed or not
when the height was calculated.
</p>
</div>
</div>
</div>

</div>
</body>
</html>
12 changes: 12 additions & 0 deletions tests/unit/accordion/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ var equalHeight = testHelper.equalHeight,

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

test( "collapsedHeight", function() {
expect( 1 );
var element = $( "#collapsible" ).accordion(),
content = element.find( ".ui-accordion-content" ),
height = content.height();
element.accordion( "destroy" ).accordion({
active: false,
collapsible: true
});
equal( content.height(), height );
});

test( "destroy", function( assert ) {
expect( 1 );
assert.domEqual( "#list1", function() {
Expand Down

0 comments on commit 5fa27f3

Please sign in to comment.