aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/accordion/accordion_test_helpers.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/accordion/accordion_test_helpers.js')
-rw-r--r--tests/unit/accordion/accordion_test_helpers.js58
1 files changed, 30 insertions, 28 deletions
diff --git a/tests/unit/accordion/accordion_test_helpers.js b/tests/unit/accordion/accordion_test_helpers.js
index 889608fba..56967793d 100644
--- a/tests/unit/accordion/accordion_test_helpers.js
+++ b/tests/unit/accordion/accordion_test_helpers.js
@@ -1,30 +1,32 @@
-function accordion_state( accordion ) {
- var expected = $.makeArray( arguments ).slice( 1 ),
- actual = accordion.find( ".ui-accordion-content" ).map(function() {
- return $( this ).css( "display" ) === "none" ? 0 : 1;
- }).get();
- QUnit.push( QUnit.equiv(actual, expected), actual, expected );
-}
+TestHelpers.accordion = {
+ equalHeights: function( accordion, min, max ) {
+ var sizes = [];
+ accordion.find( ".ui-accordion-content" ).each(function() {
+ sizes.push( $( this ).outerHeight() );
+ });
+ ok( sizes[ 0 ] >= min && sizes[ 0 ] <= max,
+ "must be within " + min + " and " + max + ", was " + sizes[ 0 ] );
+ deepEqual( sizes[ 0 ], sizes[ 1 ] );
+ deepEqual( sizes[ 0 ], sizes[ 2 ] );
+ },
-function accordion_equalHeights( accordion, min, max ) {
- var sizes = [];
- accordion.find( ".ui-accordion-content" ).each(function() {
- sizes.push( $( this ).outerHeight() );
- });
- ok( sizes[ 0 ] >= min && sizes[ 0 ] <= max,
- "must be within " + min + " and " + max + ", was " + sizes[ 0 ] );
- deepEqual( sizes[ 0 ], sizes[ 1 ] );
- deepEqual( sizes[ 0 ], sizes[ 2 ] );
-}
+ setupTeardown: function() {
+ var animate = $.ui.accordion.prototype.options.animate;
+ return {
+ setup: function() {
+ $.ui.accordion.prototype.options.animate = false;
+ },
+ teardown: function() {
+ $.ui.accordion.prototype.options.animate = animate;
+ }
+ };
+ },
-function accordion_setupTeardown() {
- var animate = $.ui.accordion.prototype.options.animate;
- return {
- setup: function() {
- $.ui.accordion.prototype.options.animate = false;
- },
- teardown: function() {
- $.ui.accordion.prototype.options.animate = animate;
- }
- };
-}
+ state: function( accordion ) {
+ var expected = $.makeArray( arguments ).slice( 1 ),
+ actual = accordion.find( ".ui-accordion-content" ).map(function() {
+ return $( this ).css( "display" ) === "none" ? 0 : 1;
+ }).get();
+ QUnit.push( QUnit.equiv(actual, expected), actual, expected );
+ }
+};