Skip to content
Permalink
Browse files

Accordion: Removed static test pages. Added unit tests for dl markup …

…structure.
  • Loading branch information...
scottgonzalez committed Mar 23, 2011
1 parent aaa21dd commit b85e11564ab16eb420ecccdcb8e328e37458c8f3

This file was deleted.

This file was deleted.

This file was deleted.

@@ -136,6 +136,27 @@ <h2><a href="?p=1.1.3">Drums</a></h2>
</ul>
</div>

<dl id="accordion-dl">
<dt>
<a href="#">Accordion Header 1</a>
</dt>
<dd>
Accordion Content 1
</dd>
<dt>
<a href="#">Accordion Header 2</a>
</dt>
<dd>
Accordion Content 2
</dd>
<dt>
<a href="#">Accordion Header 3</a>
</dt>
<dd>
Accordion Content 3
</dd>
</dl>

</div>
</body>
</html>
@@ -138,6 +138,27 @@ <h2><a href="?p=1.1.3">Drums</a></h2>
</ul>
</div>

<dl id="accordion-dl">
<dt>
<a href="#">Accordion Header 1</a>
</dt>
<dd>
Accordion Content 1
</dd>
<dt>
<a href="#">Accordion Header 2</a>
</dt>
<dd>
Accordion Content 2
</dd>
<dt>
<a href="#">Accordion Header 3</a>
</dt>
<dd>
Accordion Content 3
</dd>
</dl>

</div>
</body>
</html>
@@ -2,16 +2,18 @@

module( "accordion: core", accordionSetupTeardown() );

test( "markup structure", function() {
var ac = $( "#navigation" ).accordion();
ok( ac.hasClass( "ui-accordion" ), "main element is .ui-accordion" );
equal( ac.find( ".ui-accordion-header" ).length, 3,
".ui-accordion-header elements exist, correct number" );
equal( ac.find( ".ui-accordion-content" ).length, 3,
".ui-accordion-content elements exist, correct number" );
same( ac.find( ".ui-accordion-header" ).next().get(),
ac.find( ".ui-accordion-content" ).get(),
"content panels come immediately after headers" );
$.each( { div: "#list1", ul: "#navigation", dl: "#accordion-dl" }, function( type, selector ) {
test( "markup structure: " + type, function() {
var ac = $( selector ).accordion();
ok( ac.hasClass( "ui-accordion" ), "main element is .ui-accordion" );
equal( ac.find( ".ui-accordion-header" ).length, 3,
".ui-accordion-header elements exist, correct number" );
equal( ac.find( ".ui-accordion-content" ).length, 3,
".ui-accordion-content elements exist, correct number" );
same( ac.find( ".ui-accordion-header" ).next().get(),
ac.find( ".ui-accordion-content" ).get(),
"content panels come immediately after headers" );
});
});

test( "handle click on header-descendant", function() {

0 comments on commit b85e115

Please sign in to comment.
You can’t perform that action at this time.