jquery-ui/tests/unit/accordion/helper.js

36 lines
864 B
JavaScript
Raw Normal View History

define( [
"jquery",
"lib/helper",
"ui/widgets/accordion"
], function( $, helper ) {
return $.extend( helper, {
equalHeight: function( accordion, height ) {
accordion.find( ".ui-accordion-content" ).each(function() {
equal( $( this ).outerHeight(), height );
});
},
2011-08-03 17:52:36 +00:00
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;
}
};
},
2011-08-03 17:52:36 +00:00
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 );
}
} );
} );