From ad5bfc7f604bf298ecfeac77db50081fc33dbfd0 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Sat, 3 Apr 2010 17:08:45 +0200 Subject: [PATCH] Accordion unit tests: Refactored state-helper function --- tests/unit/accordion/accordion.html | 12 ++++++++++++ tests/unit/accordion/accordion_core.js | 11 ----------- tests/unit/accordion/accordion_methods.js | 9 --------- 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 @@ + 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() { -- 2.39.5