imported the whole jquery-ui package, refreshed with 1.10.2
[unfold.git] / third-party / jquery-ui-1.10.2 / tests / unit / accordion / accordion_test_helpers.js
diff --git a/third-party/jquery-ui-1.10.2/tests/unit/accordion/accordion_test_helpers.js b/third-party/jquery-ui-1.10.2/tests/unit/accordion/accordion_test_helpers.js
new file mode 100644 (file)
index 0000000..643f8e2
--- /dev/null
@@ -0,0 +1,27 @@
+TestHelpers.accordion = {
+       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 );
+       }
+};