diff options
author | jzaefferer <joern.zaefferer@gmail.com> | 2010-04-03 17:08:45 +0200 |
---|---|---|
committer | jzaefferer <joern.zaefferer@gmail.com> | 2010-04-03 17:08:45 +0200 |
commit | ad5bfc7f604bf298ecfeac77db50081fc33dbfd0 (patch) | |
tree | 98510a0c627a70d2b30eec21ff923ff064bd15c9 /tests | |
parent | 87ba795467ee447eb2ab7d95ada42de097c7946f (diff) | |
download | jquery-ui-ad5bfc7f604bf298ecfeac77db50081fc33dbfd0.tar.gz jquery-ui-ad5bfc7f604bf298ecfeac77db50081fc33dbfd0.zip |
Accordion unit tests: Refactored state-helper function
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/accordion/accordion.html | 12 | ||||
-rw-r--r-- | tests/unit/accordion/accordion_core.js | 11 | ||||
-rw-r--r-- | tests/unit/accordion/accordion_methods.js | 9 | ||||
-rw-r--r-- | tests/unit/accordion/accordion_options.js | 10 |
4 files changed, 12 insertions, 30 deletions
diff --git a/tests/unit/accordion/accordion.html b/tests/unit/accordion/accordion.html index df0979803..9b6cb63f2 100644 --- a/tests/unit/accordion/accordion.html +++ b/tests/unit/accordion/accordion.html @@ -16,6 +16,18 @@ <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> diff --git a/tests/unit/accordion/accordion_core.js b/tests/unit/accordion/accordion_core.js index 47d2509e6..2bef43149 100644 --- a/tests/unit/accordion/accordion_core.js +++ b/tests/unit/accordion/accordion_core.js @@ -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() { diff --git a/tests/unit/accordion/accordion_methods.js b/tests/unit/accordion/accordion_methods.js index d15a0b710..c31f22008 100644 --- a/tests/unit/accordion/accordion_methods.js +++ b/tests/unit/accordion/accordion_methods.js @@ -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() { diff --git a/tests/unit/accordion/accordion_options.js b/tests/unit/accordion/accordion_options.js index cc7fc0369..e46795993 100644 --- a/tests/unit/accordion/accordion_options.js +++ b/tests/unit/accordion/accordion_options.js @@ -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() { |