Skip to content

Commit a4da197

Browse files
committed
Accordion: Added tests for custom header option.
1 parent 2e17770 commit a4da197

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/unit/accordion/accordion_options.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ test( "{ collapsible: true }", function() {
107107

108108
// TODO: add event tests
109109

110-
// TODO: add more header tests
111110
test( "{ header: default }", function() {
112111
// default: > li > :first-child,> :not(li):even
113112
// > :not(li):even
@@ -116,6 +115,19 @@ test( "{ header: default }", function() {
116115
state( $( "#navigation" ).accordion(), 1, 0, 0);
117116
});
118117

118+
test( "{ header: custom }", function() {
119+
var ac = $( "#navigationWrapper" ).accordion({
120+
header: "h2"
121+
});
122+
ac.find( "h2" ).each(function() {
123+
ok( $( this ).hasClass( "ui-accordion-header" ) );
124+
});
125+
equal( ac.find( ".ui-accordion-header" ).length, 3 );
126+
state( ac, 1, 0, 0 );
127+
ac.accordion( "option", "active", 2 );
128+
state( ac, 0, 0, 1 );
129+
});
130+
119131
test( "{ heightStyle: 'auto' }", function() {
120132
var ac = $( "#navigation" ).accordion({ heightStyle: "auto" });
121133
equalHeights( ac, 95, 130 );

0 commit comments

Comments
 (0)