File: helper.js

package info (click to toggle)
jqueryui 1.12.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,800 kB
  • sloc: php: 584; xml: 104; makefile: 75
file content (36 lines) | stat: -rw-r--r-- 883 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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 );
	}
} );

} );