aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/accordion/options.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/accordion/options.js')
-rw-r--r--tests/unit/accordion/options.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/unit/accordion/options.js b/tests/unit/accordion/options.js
index 2dec303a9..0fcaf5b78 100644
--- a/tests/unit/accordion/options.js
+++ b/tests/unit/accordion/options.js
@@ -376,15 +376,15 @@ QUnit.test( "{ event: custom }", function( assert ) {
QUnit.test( "{ header: default }", function( assert ) {
assert.expect( 2 );
- // Default: > li > :first-child,> :not(li):even
- // > :not(li):even
+ // Default: elem.find( "> li > :first-child" ).add( elem.find( "> :not(li)" ).even() )
+ // elem.find( "> :not(li)" ).even()
state( assert, $( "#list1" ).accordion(), 1, 0, 0 );
// > li > :first-child
state( assert, $( "#navigation" ).accordion(), 1, 0, 0 );
} );
-QUnit.test( "{ header: custom }", function( assert ) {
+QUnit.test( "{ header: customString }", function( assert ) {
assert.expect( 6 );
var element = $( "#navigationWrapper" ).accordion( {
header: "h2"
@@ -398,6 +398,22 @@ QUnit.test( "{ header: custom }", function( assert ) {
state( assert, element, 0, 0, 1 );
} );
+QUnit.test( "{ header: customFunction }", function( assert ) {
+ assert.expect( 6 );
+ var element = $( "#navigationWrapper" ).accordion( {
+ header: function( elem ) {
+ return elem.find( "h2" );
+ }
+ } );
+ element.find( "h2" ).each( function() {
+ assert.hasClasses( this, "ui-accordion-header" );
+ } );
+ assert.equal( element.find( ".ui-accordion-header" ).length, 3 );
+ state( assert, element, 1, 0, 0 );
+ element.accordion( "option", "active", 2 );
+ state( assert, element, 0, 0, 1 );
+} );
+
QUnit.test( "{ heightStyle: 'auto' }", function( assert ) {
assert.expect( 3 );
var element = $( "#navigation" ).accordion( { heightStyle: "auto" } );