Skip to content
Permalink
Browse files

Accordion unit tests: Refactored state-helper function

  • Loading branch information
jzaefferer committed Apr 3, 2010
1 parent 87ba795 commit ad5bfc7f604bf298ecfeac77db50081fc33dbfd0
@@ -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>
@@ -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() {
@@ -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() {
@@ -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() {

0 comments on commit ad5bfc7

Please sign in to comment.
You can’t perform that action at this time.