diff options
Diffstat (limited to 'tests/unit/accordion/helper.js')
-rw-r--r-- | tests/unit/accordion/helper.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/unit/accordion/helper.js b/tests/unit/accordion/helper.js new file mode 100644 index 000000000..5eb3a4bc3 --- /dev/null +++ b/tests/unit/accordion/helper.js @@ -0,0 +1,35 @@ +define( [ + "jquery", + "lib/helper", + "ui/accordion" +], function( $, helper ) { + +return $.extend( helper, { + equalHeight: function( accordion, height ) { + accordion.find( ".ui-accordion-content" ).each(function() { + equal( $( this ).outerHeight(), height ); + }); + }, + + 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; + } + }; + }, + + 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 ); + } +} ); + +} ); |