Skip to content
Permalink
Browse files

Accordion tests: cleanup.

  • Loading branch information
scottgonzalez committed Aug 3, 2011
1 parent 1e9e0ed commit 4415e992c5ef0f280309acc34e6903e7161a6ac9
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Accordion Test Suite</title>

<link rel="stylesheet" href="../../../themes/base/jquery.ui.core.css">
<link rel="stylesheet" href="../../../themes/base/jquery.ui.accordion.css">

<script src="../../jquery.js"></script>
@@ -19,36 +20,7 @@
<script src="../../jquery.simulate.js"></script>
<script src="../testsuite.js"></script>

<script>
function accordion_state( accordion ) {
var expected = $.makeArray( arguments ).slice( 1 );
var actual = accordion.find( ".ui-accordion-content" ).map(function() {
return $( this ).css( "display" ) === "none" ? 0 : 1;
}).get();
deepEqual( actual, expected );
}
function accordion_equalHeights( accordion, min, max ) {
var sizes = [];
accordion.find( ".ui-accordion-content" ).each(function() {
sizes.push( $( this ).outerHeight() );
});
ok( sizes[ 0 ] >= min && sizes[ 0 ] <= max,
"must be within " + min + " and " + max + ", was " + sizes[ 0 ] );
deepEqual( sizes[ 0 ], sizes[ 1 ] );
deepEqual( sizes[ 0 ], sizes[ 2 ] );
}
function accordionSetupTeardown() {
var animated = $.ui.accordion.prototype.options.animated;
return {
setup: function() {
$.ui.accordion.prototype.options.animated = false;
},
teardown: function() {
$.ui.accordion.prototype.options.animated = animated;
}
};
}
</script>
<script src="accordion_test_helpers.js"></script>
<script src="accordion_defaults.js"></script>
<script src="accordion_core.js"></script>
<script src="accordion_events.js"></script>
@@ -57,8 +29,12 @@

<script src="../swarminject.js"></script>
<style>
#qunit-fixture { font-size: 10pt; font-family: "trebuchet ms", verdana, arial; }
#list, #list1 *, #navigation, #navigation * { margin: 0; padding: 0; font-size: 12px; line-height: 15px; }
#list, #list1 *, #navigation, #navigation * {
margin: 0;
padding: 0;
font-size: 12px;
line-height: 15px;
}
</style>
</head>
<body>
@@ -4,6 +4,7 @@
<meta charset="utf-8">
<title>jQuery UI Accordion Test Suite</title>

<link rel="stylesheet" href="../../../themes/base/jquery.ui.core.css">
<link rel="stylesheet" href="../../../themes/base/jquery.ui.accordion.css">

<script src="../../jquery.js"></script>
@@ -16,36 +17,7 @@
<script src="../../jquery.simulate.js"></script>
<script src="../testsuite.js"></script>

<script>
function accordion_state( accordion ) {
var expected = $.makeArray( arguments ).slice( 1 );
var actual = accordion.find( ".ui-accordion-content" ).map(function() {
return $( this ).css( "display" ) === "none" ? 0 : 1;
}).get();
deepEqual( actual, expected );
}
function accordion_equalHeights( accordion, min, max ) {
var sizes = [];
accordion.find( ".ui-accordion-content" ).each(function() {
sizes.push( $( this ).outerHeight() );
});
ok( sizes[ 0 ] >= min && sizes[ 0 ] <= max,
"must be within " + min + " and " + max + ", was " + sizes[ 0 ] );
deepEqual( sizes[ 0 ], sizes[ 1 ] );
deepEqual( sizes[ 0 ], sizes[ 2 ] );
}
function accordionSetupTeardown() {
var animated = $.ui.accordion.prototype.options.animated;
return {
setup: function() {
$.ui.accordion.prototype.options.animated = false;
},
teardown: function() {
$.ui.accordion.prototype.options.animated = animated;
}
};
}
</script>
<script src="accordion_test_helpers.js"></script>
<script src="accordion_defaults_deprecated.js"></script>
<script src="accordion_core.js"></script>
<script src="accordion_events.js"></script>
@@ -55,8 +27,12 @@

<script src="../swarminject.js"></script>
<style>
#qunit-fixture { font-size: 10pt; font-family: "trebuchet ms", verdana, arial; }
#list, #list1 *, #navigation, #navigation * { margin: 0; padding: 0; font-size: 12px; line-height: 15px; }
#list, #list1 *, #navigation, #navigation * {
margin: 0;
padding: 0;
font-size: 12px;
line-height: 15px;
}
</style>
</head>
<body>
@@ -0,0 +1,30 @@
function accordion_state( accordion ) {
var expected = $.makeArray( arguments ).slice( 1 );
var actual = accordion.find( ".ui-accordion-content" ).map(function() {
return $( this ).css( "display" ) === "none" ? 0 : 1;
}).get();
deepEqual( actual, expected );
}

function accordion_equalHeights( accordion, min, max ) {
var sizes = [];
accordion.find( ".ui-accordion-content" ).each(function() {
sizes.push( $( this ).outerHeight() );
});
ok( sizes[ 0 ] >= min && sizes[ 0 ] <= max,
"must be within " + min + " and " + max + ", was " + sizes[ 0 ] );
deepEqual( sizes[ 0 ], sizes[ 1 ] );
deepEqual( sizes[ 0 ], sizes[ 2 ] );
}

function accordionSetupTeardown() {
var animated = $.ui.accordion.prototype.options.animated;
return {
setup: function() {
$.ui.accordion.prototype.options.animated = false;
},
teardown: function() {
$.ui.accordion.prototype.options.animated = animated;
}
};
}

0 comments on commit 4415e99

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