aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/attributes.js
diff options
context:
space:
mode:
authorMike Sherov <mike.sherov@gmail.com>2012-09-29 00:23:55 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-09-30 20:40:45 -0400
commitf9ef91d6d68dc7317bb12c1ae2a8201f28facff1 (patch)
treee9596abb03cbb2f435429ef820905cbeb809b5a0 /test/unit/attributes.js
parentc3b1367f4c19abf12eadc1460a37dc34ae765e1b (diff)
downloadjquery-f9ef91d6d68dc7317bb12c1ae2a8201f28facff1.tar.gz
jquery-f9ef91d6d68dc7317bb12c1ae2a8201f28facff1.zip
Fix #10943, tabindex not set properly on clone in IE7. Close gh-937.
This is only a unit test fix because the bug was tangentially fixed by a different commit
Diffstat (limited to 'test/unit/attributes.js')
-rw-r--r--test/unit/attributes.js41
1 files changed, 23 insertions, 18 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js
index 07608b4bd..7ff55aa18 100644
--- a/test/unit/attributes.js
+++ b/test/unit/attributes.js
@@ -654,41 +654,46 @@ test("prop('tabindex')", function() {
equal(jQuery("#linkWithNoHrefWithNegativeTabIndex").prop("tabindex"), -1, "anchor without href, no tabindex set");
});
-test("prop('tabindex', value)", function() {
- expect(9);
+test("prop('tabindex', value)", 10, function() {
+
+ var element = jQuery("#divWithNoTabIndex"),
+ clone;
- var element = jQuery("#divWithNoTabIndex");
equal(element.prop("tabindex"), undefined, "start with no tabindex");
// set a positive string
- element.prop("tabindex", "1");
- equal(element.prop("tabindex"), 1, "set tabindex to 1 (string)");
+ element.prop( "tabindex", "1" );
+ equal( element.prop("tabindex"), 1, "set tabindex to 1 (string)" );
// set a zero string
- element.prop("tabindex", "0");
- equal(element.prop("tabindex"), 0, "set tabindex to 0 (string)");
+ element.prop( "tabindex", "0" );
+ equal( element.prop("tabindex"), 0, "set tabindex to 0 (string)" );
// set a negative string
- element.prop("tabindex", "-1");
- equal(element.prop("tabindex"), -1, "set tabindex to -1 (string)");
+ element.prop( "tabindex", "-1" );
+ equal( element.prop("tabindex"), -1, "set tabindex to -1 (string)" );
// set a positive number
- element.prop("tabindex", 1);
- equal(element.prop("tabindex"), 1, "set tabindex to 1 (number)");
+ element.prop( "tabindex", 1 );
+ equal( element.prop("tabindex"), 1, "set tabindex to 1 (number)" );
// set a zero number
- element.prop("tabindex", 0);
- equal(element.prop("tabindex"), 0, "set tabindex to 0 (number)");
+ element.prop( "tabindex", 0 );
+ equal( element.prop("tabindex"), 0, "set tabindex to 0 (number)" );
// set a negative number
- element.prop("tabindex", -1);
- equal(element.prop("tabindex"), -1, "set tabindex to -1 (number)");
+ element.prop( "tabindex", -1 );
+ equal( element.prop("tabindex"), -1, "set tabindex to -1 (number)" );
element = jQuery("#linkWithTabIndex");
- equal(element.prop("tabindex"), 2, "start with tabindex 2");
+ equal( element.prop("tabindex"), 2, "start with tabindex 2" );
+
+ element.prop( "tabindex", -1 );
+ equal( element.prop("tabindex"), -1, "set negative tabindex" );
- element.prop("tabindex", -1);
- equal(element.prop("tabindex"), -1, "set negative tabindex");
+ clone = element.clone();
+ clone.prop( "tabindex", 1 );
+ equal( clone[ 0 ].getAttribute("tabindex"), 1, "set tabindex on cloned element" );
});
test("removeProp(String)", function() {