Accordion unit tests: Refactored state-helper function

This commit is contained in:
jzaefferer 2010-04-03 17:08:45 +02:00
parent 87ba795467
commit ad5bfc7f60
4 changed files with 12 additions and 30 deletions

View File

@ -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>

View 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() {

View 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() {

View 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() {