]> source.dussan.org Git - jquery-ui.git/commitdiff
Accordion unit tests: Refactored state-helper function
authorjzaefferer <joern.zaefferer@gmail.com>
Sat, 3 Apr 2010 15:08:45 +0000 (17:08 +0200)
committerjzaefferer <joern.zaefferer@gmail.com>
Sat, 3 Apr 2010 15:08:45 +0000 (17:08 +0200)
tests/unit/accordion/accordion.html
tests/unit/accordion/accordion_core.js
tests/unit/accordion/accordion_methods.js
tests/unit/accordion/accordion_options.js

index df09798030670e95a8cdf5f283224f4033f43d4d..9b6cb63f28f42b0670ccadde208bbada9fa50a05 100644 (file)
        <script type="text/javascript" src="../../jquery.simulate.js"></script>
        <script type="text/javascript" src="../testsuite.js"></script>
 
+       <script type="text/javascript">
+               $.ui.accordion.prototype.options.animated = false;
+
+               function state(accordion) {
+                       var args = $.makeArray(arguments).slice(1);
+                       var result = [];
+                       $.each(args, function(i, n) {
+                               result.push( accordion.find(".ui-accordion-content").eq(i).is(":visible") ? 1 : 0 );
+                       });
+                       same(args, result)
+               }
+       </script>
        <script type="text/javascript" src="accordion_core.js"></script>
        <script type="text/javascript" src="accordion_defaults.js"></script>
        <script type="text/javascript" src="accordion_events.js"></script>
index 47d2509e6e7df8241652306e7a4e86a3513b62df..2bef43149b9e156b653a583f9da47ccee94e116f 100644 (file)
@@ -5,17 +5,6 @@
 
 (function($) {
 
-$.ui.accordion.prototype.options.animated = false;
-
-function state(accordion) {
-       var args = $.makeArray(arguments).slice(1);
-       var result = [];
-       $.each(args, function(i, n) {
-               result.push( accordion.find(".ui-accordion-content").eq(i).is(":visible") ? 1 : 0 );
-       });
-       same(args, result)
-}
-
 module("accordion: core");
 
 test("handle click on header-descendant", function() {
index d15a0b710542659463bfac43728a3c44d10df4b1..c31f22008974200a63d2cd4b4ff2b42a57d1949e 100644 (file)
@@ -3,15 +3,6 @@
  */
 (function($) {
 
-function state(accordion) {
-       var expected = $.makeArray(arguments).slice(1);
-       var actual = [];
-       $.each(expected, function(i, n) {
-               actual.push( accordion.find(".ui-accordion-content").eq(i).is(":visible") ? 1 : 0 );
-       });
-       same(actual, expected)
-}
-
 module("accordion: methods");
 
 test("init", function() {
index cc7fc0369d973e44374358da5517848458fe8e17..e46795993f0d6a5f5572cf1d3525576381e42733 100644 (file)
@@ -3,16 +3,6 @@
  */
 (function($) {
 
-function state(accordion) {
-       var expected = $.makeArray(arguments).slice(1);
-       var actual = [];
-       $.each(expected, function(i, n) {
-               actual.push( accordion.find(".ui-accordion-content").eq(i).is(":visible") ? 1 : 0 );
-       });
-       same(actual, expected)
-}
-
-
 module("accordion: options");
 
 test("{ active: first child }, default", function() {