aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjzaefferer <joern.zaefferer@gmail.com>2010-04-03 17:08:45 +0200
committerjzaefferer <joern.zaefferer@gmail.com>2010-04-03 17:08:45 +0200
commitad5bfc7f604bf298ecfeac77db50081fc33dbfd0 (patch)
tree98510a0c627a70d2b30eec21ff923ff064bd15c9 /tests
parent87ba795467ee447eb2ab7d95ada42de097c7946f (diff)
downloadjquery-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.html12
-rw-r--r--tests/unit/accordion/accordion_core.js11
-rw-r--r--tests/unit/accordion/accordion_methods.js9
-rw-r--r--tests/unit/accordion/accordion_options.js10
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() {