aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/accordion
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/accordion')
-rw-r--r--tests/unit/accordion/accordion.html6
-rw-r--r--tests/unit/accordion/accordion_options.js24
2 files changed, 19 insertions, 11 deletions
diff --git a/tests/unit/accordion/accordion.html b/tests/unit/accordion/accordion.html
index bce2e8cd7..fbb3a85d0 100644
--- a/tests/unit/accordion/accordion.html
+++ b/tests/unit/accordion/accordion.html
@@ -58,7 +58,7 @@
<ul id="navigation">
<li>
- <a href="?p=1.1.1">Guitar</a>
+ <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>
@@ -68,7 +68,7 @@
</ul>
</li>
<li>
- <a href="?p=1.1.2"><span>Bass</span></a>
+ <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>
@@ -80,7 +80,7 @@
</ul>
</li>
<li>
- <a href="?p=1.1.3">Drums</a>
+ <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>
diff --git a/tests/unit/accordion/accordion_options.js b/tests/unit/accordion/accordion_options.js
index 1ef6542a3..95edae597 100644
--- a/tests/unit/accordion/accordion_options.js
+++ b/tests/unit/accordion/accordion_options.js
@@ -136,16 +136,24 @@ test("{ icons: false }", function() {
icons(false);
});
-test("{ navigation: false }, default", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("{ navigation: true }", function() {
- ok(false, 'missing test - untested code is broken code');
+test("{ navigation: true, navigationFilter: header }", function() {
+ $("#navigation").accordion({
+ navigation: true,
+ navigationFilter: function() {
+ return /\?p=1\.1\.3$/.test(this.href);
+ }
+ });
+ equals( $("#navigation .ui-accordion-content:eq(2)").size(), 1, "third content active" );
});
-test("{ navigationFilter: Function }, default", function() {
- ok(false, 'missing test - untested code is broken code');
+test("{ navigation: true, navigationFilter: content }", function() {
+ $("#navigation").accordion({
+ navigation: true,
+ navigationFilter: function() {
+ return /\?p=1\.1\.3\.2$/.test(this.href);
+ }
+ });
+ equals( $("#navigation .ui-accordion-content:eq(2)").size(), 1, "third content active" );
});
})(jQuery);