aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlex Dovenmuehle <adovenmuehle@gmail.com>2010-12-06 00:56:19 -0500
committerScott González <scott.gonzalez@gmail.com>2010-12-10 14:54:50 -0500
commitf54747b30234454fc6dd6fb720c4b73dc8b87345 (patch)
treed7cfc6c286929dadf7a779c42d49f13346cc7278 /tests
parent0cc1a0c03085f783c24aaf30488a62eb136f3b5a (diff)
downloadjquery-ui-f54747b30234454fc6dd6fb720c4b73dc8b87345.tar.gz
jquery-ui-f54747b30234454fc6dd6fb720c4b73dc8b87345.zip
Accordion: Added .ui-accordion-heading class to header's first child. Fixes #6743 - Accordion: Add .ui-accordion-heading class.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/accordion/accordion.html6
-rw-r--r--tests/unit/accordion/accordion_core.js7
-rw-r--r--tests/unit/accordion/accordion_methods.js8
-rw-r--r--tests/unit/accordion/accordion_options.js12
4 files changed, 20 insertions, 13 deletions
diff --git a/tests/unit/accordion/accordion.html b/tests/unit/accordion/accordion.html
index b27de095d..61d168386 100644
--- a/tests/unit/accordion/accordion.html
+++ b/tests/unit/accordion/accordion.html
@@ -64,7 +64,7 @@
<div>
<div id="list1" class="foo">
- <a class="bar">There is one obvious advantage:</a>
+ <h3 class="bar"><a class="anchor">There is one obvious advantage:</a></h3>
<div class="foo">
<p>
You've seen it coming!
@@ -74,7 +74,7 @@
Well, at least no free beer. Perhaps a bear, if you can afford it.
</p>
</div>
- <a class="bar">Now that you've got...</a>
+ <h3 class="bar"><a class="anchor">Now that you've got...</a></h3>
<div class="foo">
<p>
your bear, you have to admit it!
@@ -85,7 +85,7 @@
We could talk about renting one.
</p>
</div>
- <a class="bar">Rent one bear, ...</a>
+ <h3 class="bar"><a class="anchor">Rent one bear, ...</a></h3>
<div class="foo">
<p>
get two for three beer.
diff --git a/tests/unit/accordion/accordion_core.js b/tests/unit/accordion/accordion_core.js
index 2bef43149..640427e2e 100644
--- a/tests/unit/accordion/accordion_core.js
+++ b/tests/unit/accordion/accordion_core.js
@@ -13,6 +13,13 @@ test("handle click on header-descendant", function() {
state(ac, 0, 1, 0);
});
+test("ui-accordion-heading class added to headers anchor", function() {
+ expect(1);
+ var ac = $("#list1").accordion();
+ var anchors = $(".ui-accordion-heading");
+ equals( anchors.length, "3");
+});
+
test("accessibility", function () {
expect(9);
var ac = $('#list1').accordion().accordion("activate", 1);
diff --git a/tests/unit/accordion/accordion_methods.js b/tests/unit/accordion/accordion_methods.js
index 96688b59e..ed5cb37b6 100644
--- a/tests/unit/accordion/accordion_methods.js
+++ b/tests/unit/accordion/accordion_methods.js
@@ -95,7 +95,7 @@ test("activate, boolean, collapsible: false", function() {
});
test("activate, string expression", function() {
- var ac = $('#list1').accordion({ active: "a:last" });
+ var ac = $('#list1').accordion({ active: "h3:last" });
state(ac, 0, 0, 1);
ac.accordion("activate", ":first");
state(ac, 1, 0, 0);
@@ -106,11 +106,11 @@ test("activate, string expression", function() {
});
test("activate, jQuery or DOM element", function() {
- var ac = $('#list1').accordion({ active: $("#list1 a:last") });
+ var ac = $('#list1').accordion({ active: $("#list1 h3:last") });
state(ac, 0, 0, 1);
- ac.accordion("activate", $("#list1 a:first"));
+ ac.accordion("activate", $("#list1 h3:first"));
state(ac, 1, 0, 0);
- ac.accordion("activate", $("#list1 a")[1]);
+ ac.accordion("activate", $("#list1 h3")[1]);
state(ac, 0, 1, 0);
});
diff --git a/tests/unit/accordion/accordion_options.js b/tests/unit/accordion/accordion_options.js
index 499fec383..291deb214 100644
--- a/tests/unit/accordion/accordion_options.js
+++ b/tests/unit/accordion/accordion_options.js
@@ -13,28 +13,28 @@ test("{ active: first child }, default", function() {
test("{ active: Selector }", function() {
var ac = $("#list1").accordion({
- active: "a:last"
+ active: "h3:last"
});
state(ac, 0, 0, 1);
- ac.accordion('option', 'active', "a:eq(1)");
+ ac.accordion('option', 'active', "h3:eq(1)");
state(ac, 0, 1, 0);
});
test("{ active: Element }", function() {
var ac = $("#list1").accordion({
- active: $("#list1 a:last")[0]
+ active: $("#list1 h3:last")[0]
});
state(ac, 0, 0, 1);
- ac.accordion('option', 'active', $("#list1 a:eq(1)")[0]);
+ ac.accordion('option', 'active', $("#list1 h3:eq(1)")[0]);
state(ac, 0, 1, 0);
});
test("{ active: jQuery Object }", function() {
var ac = $("#list1").accordion({
- active: $("#list1 a:last")
+ active: $("#list1 h3:last")
});
state(ac, 0, 0, 1);
- ac.accordion('option', 'active', $("#list1 a:eq(1)"));
+ ac.accordion('option', 'active', $("#list1 h3:eq(1)"));
state(ac, 0, 1, 0);
});