Debian Codegraph @

tests/unit/accordion/helper.js

raw symbols SCIP
1 define( [
2 "qunit",
3 "jquery",
4 "lib/helper",
5 "ui/widgets/accordion"
6 ], function( QUnit, $, helper ) {
7 "use strict";
8
9 return $.extend( helper, {
10 equalHeight: function( assert, accordion, height ) {
11 accordion.find( ".ui-accordion-content" ).each( function() {
12 assert.equal( $( this ).outerHeight(), height );
13 } );
14 },
15
16 beforeAfterEach: function() {
17 var animate = $.ui.accordion.prototype.options.animate;
18 return {
19 beforeEach: function() {
20 $.ui.accordion.prototype.options.animate = false;
21 },
22 afterEach: function() {
23 $.ui.accordion.prototype.options.animate = animate;
24 return helper.moduleAfterEach.apply( this, arguments );
25 }
26 };
27 },
28
29 state: function( assert, accordion ) {
30 var expected = $.makeArray( arguments ).slice( 2 ),
31 actual = accordion.find( ".ui-accordion-content" ).map( function() {
32 return $( this ).css( "display" ) === "none" ? 0 : 1;
33 } ).get();
34 assert.deepEqual( actual, expected );
35 }
36 } );
37
38 } );