Skip to content
Permalink
Browse files

Accordion: First pass at splitting out tests for deprecated functiona…

…lity.
  • Loading branch information
scottgonzalez committed Jan 24, 2011
1 parent cc90b44 commit c96c2497803779c11d8e666f2f8129bbba01fee9
@@ -1,55 +1,58 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta charset="utf-8">
<title>jQuery UI Accordion Test Suite</title>

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

<script type="text/javascript" src="../../../jquery-1.4.4.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.core.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.widget.js"></script>
<script type="text/javascript" src="../../../ui/jquery.ui.accordion.js"></script>
<script src="../../../jquery-1.4.4.js"></script>
<script>
$.uiBackCompat = false;
</script>
<script src="../../../ui/jquery.ui.core.js"></script>
<script src="../../../ui/jquery.ui.widget.js"></script>
<script src="../../../ui/jquery.ui.accordion.js"></script>

<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
<script type="text/javascript" src="../../../external/qunit.js"></script>
<script type="text/javascript" src="../../jquery.simulate.js"></script>
<script type="text/javascript" src="../testsuite.js"></script>
<link rel="stylesheet" href="../../../external/qunit.css">
<script src="../../../external/qunit.js"></script>
<script src="../../jquery.simulate.js"></script>
<script src="../testsuite.js"></script>

<script type="text/javascript">
$.ui.accordion.prototype.options.animated = false;
<script>
$.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).filter(function() {
return $(this).css("display") != "none"
}).length ? 1 : 0 );
});
same(args, result)
}
function 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] );
same(sizes[0], sizes[1]);
same(sizes[0], sizes[2]);
}
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).filter(function() {
return $(this).css("display") != "none"
}).length ? 1 : 0 );
});
same(args, result)
}
function 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] );
same(sizes[0], sizes[1]);
same(sizes[0], sizes[2]);
}
</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>
<script type="text/javascript" src="accordion_methods.js"></script>
<script type="text/javascript" src="accordion_options.js"></script>
<script type="text/javascript" src="accordion_tickets.js"></script>
<script type="text/javascript" src="../swarminject.js"></script>
<script src="accordion_core.js"></script>
<script src="accordion_defaults.js"></script>
<script src="accordion_events.js"></script>
<script src="accordion_methods.js"></script>
<script src="accordion_options.js"></script>
<script src="accordion_tickets.js"></script>

<script src="../swarminject.js"></script>
<style>
#main { font-size: 10pt; font-family: 'trebuchet ms', verdana, arial; }
#list, #list1 *, #navigation, #navigation * { margin: 0; padding: 0; font-size: 12px; }
#main { font-size: 10pt; font-family: "trebuchet ms", verdana, arial; }
#list, #list1 *, #navigation, #navigation * { margin: 0; padding: 0; font-size: 12px; }
</style>
</head>
<body>
@@ -5,19 +5,15 @@
var accordion_defaults = {
active: 0,
animated: false,
autoHeight: true,
clearStyle: false,
collapsible: false,
disabled: false,
event: "click",
fillSpace: false,
header: "> li > :first-child,> :not(li):even",
heightStyle: null,
icons: { "header": "ui-icon-triangle-1-e",
"activeHeader": null,
"headerSelected": "ui-icon-triangle-1-s" },
navigation: false,
navigationFilter: function() {}
heightStyle: "auto",
icons: {
"header": "ui-icon-triangle-1-e",
"activeHeader": "ui-icon-triangle-1-s"
}
};

commonWidgetTests('accordion', { defaults: accordion_defaults });
commonWidgetTests( "accordion", { defaults: accordion_defaults } );
@@ -0,0 +1,25 @@
/*
* accordion_defaults.js
*/

var accordion_defaults = {
active: 0,
animated: false,
autoHeight: true,
clearStyle: false,
collapsible: false,
disabled: false,
event: "click",
fillSpace: false,
header: "> li > :first-child,> :not(li):even",
heightStyle: null,
icons: {
"header": "ui-icon-triangle-1-e",
"activeHeader": null,
"headerSelected": "ui-icon-triangle-1-s"
},
navigation: false,
navigationFilter: function() {}
};

commonWidgetTests( "accordion", { defaults: accordion_defaults } );
@@ -0,0 +1,139 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Accordion Test Suite</title>

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

<script src="../../../jquery-1.4.4.js"></script>
<script src="../../../ui/jquery.ui.core.js"></script>
<script src="../../../ui/jquery.ui.widget.js"></script>
<script src="../../../ui/jquery.ui.accordion.js"></script>

<link rel="stylesheet" href="../../../external/qunit.css">
<script src="../../../external/qunit.js"></script>
<script src="../../jquery.simulate.js"></script>
<script src="../testsuite.js"></script>

<script>
$.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).filter(function() {
return $(this).css("display") != "none"
}).length ? 1 : 0 );
});
same(args, result)
}
function 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] );
same(sizes[0], sizes[1]);
same(sizes[0], sizes[2]);
}
</script>
<script src="accordion_core.js"></script>
<script src="accordion_defaults_deprecated.js"></script>
<script src="accordion_events.js"></script>
<script src="accordion_methods.js"></script>
<script src="accordion_options.js"></script>
<script src="accordion_tickets.js"></script>
<script src="accordion_deprecated.js"></script>

<script src="../swarminject.js"></script>
<style>
#main { font-size: 10pt; font-family: "trebuchet ms", verdana, arial; }
#list, #list1 *, #navigation, #navigation * { margin: 0; padding: 0; font-size: 12px; }
</style>
</head>
<body>

<h1 id="qunit-header">jQuery UI Accordion Test Suite</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests">
</ol>

<div id="main" style="position: absolute; top: -10000px; left: -10000px;">

<div>
<div id="list1" class="foo">
<h3 class="bar"><a class="anchor">There is one obvious advantage:</a></h3>
<div class="foo">
<p>
You've seen it coming!
<br/>
Buy now and get nothing for free!
<br/>
Well, at least no free beer. Perhaps a bear, if you can afford it.
</p>
</div>
<h3 class="bar"><a class="anchor">Now that you've got...</a></h3>
<div class="foo">
<p>
your bear, you have to admit it!
<br/>
No, we aren't selling bears.
</p>
<p>
We could talk about renting one.
</p>
</div>
<h3 class="bar"><a class="anchor">Rent one bear, ...</a></h3>
<div class="foo">
<p>
get two for three beer.
</p>
<p>
And now, for something completely different.
</p>
</div>
</div>
</div>

<div id="navigationWrapper">
<ul id="navigation">
<li>
<h2><a href="?p=1.1.1">Guitar</a></h2>
<ul>
<li><a href="?p=1.1.1.1">Electric</a></li>
<li><a href="?p=1.1.1.2">Acoustic</a></li>
<li><a href="?p=1.1.1.3">Amps</a></li>
<li><a href="?p=1.1.1.4">Effects</a></li>
<li><a href="?p=1.1.1.5">Accessories</a></li>
</ul>
</li>
<li>
<h2><a href="?p=1.1.2"><span>Bass</span></a></h2>
<ul>
<li><a href="?p=1.1.2.1">Electric</a></li>
<li><a href="?p=1.1.2.2">Acoustic</a></li>
<li><a href="?p=1.1.2.3">Amps</a></li>
<li><a href="?p=1.1.2.4">Effects</a></li>
<li><a href="?p=1.1.2.5">Accessories</a></li>
<li><a href="?p=1.1.2.5">Accessories</a></li>
<li><a href="?p=1.1.2.5">Accessories</a></li>
</ul>
</li>
<li>
<h2><a href="?p=1.1.3">Drums</a></h2>
<ul>
<li><a href="?p=1.1.3.2">Acoustic Drums</a></li>
<li><a href="?p=1.1.3.3">Electronic Drums</a></li>
<li><a href="?p=1.1.3.6">Accessories</a></li>
</ul>
</li>
</ul>
</div>

</div>

</body>
</html>

0 comments on commit c96c249

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