mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Accordion unit tests: Refactored state-helper function
This commit is contained in:
parent
87ba795467
commit
ad5bfc7f60
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user