From 050958277317cf127b98f8ac26f70f57cf147b26 Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Wed, 7 Mar 2012 19:17:09 +0100 Subject: Accordion: Fix unbinding of accordion event option when dealing with multiple events. Make sure to unbind only those namespaced to .accordion --- tests/unit/accordion/accordion_options.js | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/unit/accordion/accordion_options.js b/tests/unit/accordion/accordion_options.js index 8206b1d62..74a9a3177 100644 --- a/tests/unit/accordion/accordion_options.js +++ b/tests/unit/accordion/accordion_options.js @@ -152,6 +152,7 @@ test( "{ event: custom }", function() { // ensure old event handlers are unbound element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom1" ); + element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom2" ); equal( element.accordion( "option", "active" ), 2 ); accordion_state( element, 0, 0, 1 ); -- cgit v1.2.3 From 724772e591e9e721b33c7e2739649b9c5d7a4246 Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Wed, 7 Mar 2012 19:45:20 +0100 Subject: Accordion: Update test helper to use QUnit.push instead of deepEqual to get useful stacktrace --- tests/unit/accordion/accordion_test_helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/unit/accordion/accordion_test_helpers.js b/tests/unit/accordion/accordion_test_helpers.js index 7b316e983..542809ea0 100644 --- a/tests/unit/accordion/accordion_test_helpers.js +++ b/tests/unit/accordion/accordion_test_helpers.js @@ -3,7 +3,7 @@ function accordion_state( accordion ) { var actual = accordion.find( ".ui-accordion-content" ).map(function() { return $( this ).css( "display" ) === "none" ? 0 : 1; }).get(); - deepEqual( actual, expected ); + QUnit.push( QUnit.equiv(actual, expected), actual, expected ); } function accordion_equalHeights( accordion, min, max ) { -- cgit v1.2.3 From c7cf13f5ed42823fc52eae6f6376438af8467a00 Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Wed, 7 Mar 2012 19:54:06 +0100 Subject: Accordion: Update method tests - active option still works when accordion is disabled --- tests/unit/accordion/accordion_methods.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/unit/accordion/accordion_methods.js b/tests/unit/accordion/accordion_methods.js index 9f61647c4..2f4722070 100644 --- a/tests/unit/accordion/accordion_methods.js +++ b/tests/unit/accordion/accordion_methods.js @@ -10,15 +10,19 @@ test( "destroy", function() { }); test( "enable/disable", function() { - expect( 3 ); + expect( 4 ); var element = $( "#list1" ).accordion(); accordion_state( element, 1, 0, 0 ); element.accordion( "disable" ); - element.accordion( "option", "active", 1 ); + // event does nothing + element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "click" ); accordion_state( element, 1, 0, 0 ); - element.accordion( "enable" ); + // option still works element.accordion( "option", "active", 1 ); accordion_state( element, 0, 1, 0 ); + element.accordion( "enable" ); + element.accordion( "option", "active", 2 ); + accordion_state( element, 0, 0, 1 ); }); test( "refresh", function() { -- cgit v1.2.3