Accordion: Added tests for custom header option.

This commit is contained in:
Scott González 2011-02-03 10:11:00 -05:00
parent 2e17770e54
commit a4da197a91

View File

@ -107,7 +107,6 @@ test( "{ collapsible: true }", function() {
// TODO: add event tests
// TODO: add more header tests
test( "{ header: default }", function() {
// default: > li > :first-child,> :not(li):even
// > :not(li):even
@ -116,6 +115,19 @@ test( "{ header: default }", function() {
state( $( "#navigation" ).accordion(), 1, 0, 0);
});
test( "{ header: custom }", function() {
var ac = $( "#navigationWrapper" ).accordion({
header: "h2"
});
ac.find( "h2" ).each(function() {
ok( $( this ).hasClass( "ui-accordion-header" ) );
});
equal( ac.find( ".ui-accordion-header" ).length, 3 );
state( ac, 1, 0, 0 );
ac.accordion( "option", "active", 2 );
state( ac, 0, 0, 1 );
});
test( "{ heightStyle: 'auto' }", function() {
var ac = $( "#navigation" ).accordion({ heightStyle: "auto" });
equalHeights( ac, 95, 130 );