nsedit/tests/unit/accordion/helper.js
Mark Schouten d32092c1f0 Squashed 'jquery-ui/' content from commit 3dd8a09
git-subtree-dir: jquery-ui
git-subtree-split: 3dd8a09b441d65445f2b6a7c73e72af65445d5da
2016-08-05 12:47:57 +02:00

36 lines
883 B
JavaScript

define( [
"qunit",
"jquery",
"lib/helper",
"ui/widgets/accordion"
], function( QUnit, $, helper ) {
return $.extend( helper, {
equalHeight: function( assert, accordion, height ) {
accordion.find( ".ui-accordion-content" ).each( function() {
assert.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( assert, accordion ) {
var expected = $.makeArray( arguments ).slice( 2 ),
actual = accordion.find( ".ui-accordion-content" ).map( function() {
return $( this ).css( "display" ) === "none" ? 0 : 1;
} ).get();
assert.deepEqual( actual, expected );
}
} );
} );