diff options
author | timmywil <timmywillisn@gmail.com> | 2012-05-30 14:16:27 -0400 |
---|---|---|
committer | timmywil <timmywillisn@gmail.com> | 2012-05-30 15:00:30 -0400 |
commit | 1122c8ce32e685648bf364eb4bb84bb706d7e3b4 (patch) | |
tree | 8e74b9f24fbcdee2b28711c013484ed533231921 /test | |
parent | f633c7f165dc63b0df49159bdea2f3d62c876fe2 (diff) | |
download | jquery-1122c8ce32e685648bf364eb4bb84bb706d7e3b4.tar.gz jquery-1122c8ce32e685648bf364eb4bb84bb706d7e3b4.zip |
Adjust the return type for the tabindex attribute tests to be a string. Recomment a tabindex test since FF12's QSA includes video elements that don't have a tabindex attribute.
Related:
https://bugzilla.mozilla.org/show_bug.cgi?id=618737
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/attributes.js | 26 | ||||
-rw-r--r-- | test/unit/selector.js | 5 |
2 files changed, 15 insertions, 16 deletions
diff --git a/test/unit/attributes.js b/test/unit/attributes.js index 87f95ae87..95dfd7669 100644 --- a/test/unit/attributes.js +++ b/test/unit/attributes.js @@ -413,18 +413,18 @@ test("attr('tabindex')", function() { expect( 8 ); // elements not natively tabbable - equal( jQuery("#listWithTabIndex").attr("tabindex"), 5, "not natively tabbable, with tabindex set to 0" ); + equal( jQuery("#listWithTabIndex").attr("tabindex"), "5", "not natively tabbable, with tabindex set to 0" ); equal( jQuery("#divWithNoTabIndex").attr("tabindex"), undefined, "not natively tabbable, no tabindex set" ); // anchor with href equal( jQuery("#linkWithNoTabIndex").attr("tabindex"), undefined, "anchor with href, no tabindex set" ); - equal( jQuery("#linkWithTabIndex").attr("tabindex"), 2, "anchor with href, tabindex set to 2" ); - equal( jQuery("#linkWithNegativeTabIndex").attr("tabindex"), -1, "anchor with href, tabindex set to -1" ); + equal( jQuery("#linkWithTabIndex").attr("tabindex"), "2", "anchor with href, tabindex set to 2" ); + equal( jQuery("#linkWithNegativeTabIndex").attr("tabindex"), "-1", "anchor with href, tabindex set to -1" ); // anchor without href equal( jQuery("#linkWithNoHrefWithNoTabIndex").attr("tabindex"), undefined, "anchor without href, no tabindex set" ); - equal( jQuery("#linkWithNoHrefWithTabIndex").attr("tabindex"), 1, "anchor without href, tabindex set to 2" ); - equal( jQuery("#linkWithNoHrefWithNegativeTabIndex").attr("tabindex"), -1, "anchor without href, no tabindex set" ); + equal( jQuery("#linkWithNoHrefWithTabIndex").attr("tabindex"), "1", "anchor without href, tabindex set to 2" ); + equal( jQuery("#linkWithNoHrefWithNegativeTabIndex").attr("tabindex"), "-1", "anchor without href, no tabindex set" ); }); test("attr('tabindex', value)", function() { @@ -435,33 +435,33 @@ test("attr('tabindex', value)", function() { // set a positive string element.attr("tabindex", "1"); - equal( element.attr("tabindex"), 1, "set tabindex to 1 (string)" ); + equal( element.attr("tabindex"), "1", "set tabindex to 1 (string)" ); // set a zero string element.attr("tabindex", "0"); - equal( element.attr("tabindex"), 0, "set tabindex to 0 (string)" ); + equal( element.attr("tabindex"), "0", "set tabindex to 0 (string)" ); // set a negative string element.attr("tabindex", "-1"); - equal( element.attr("tabindex"), -1, "set tabindex to -1 (string)" ); + equal( element.attr("tabindex"), "-1", "set tabindex to -1 (string)" ); // set a positive number element.attr("tabindex", 1); - equal( element.attr("tabindex"), 1, "set tabindex to 1 (number)" ); + equal( element.attr("tabindex"), "1", "set tabindex to 1 (number)" ); // set a zero number element.attr("tabindex", 0); - equal(element.attr("tabindex"), 0, "set tabindex to 0 (number)"); + equal(element.attr("tabindex"), "0", "set tabindex to 0 (number)"); // set a negative number element.attr("tabindex", -1); - equal( element.attr("tabindex"), -1, "set tabindex to -1 (number)" ); + equal( element.attr("tabindex"), "-1", "set tabindex to -1 (number)" ); element = jQuery("#linkWithTabIndex"); - equal( element.attr("tabindex"), 2, "start with tabindex 2" ); + equal( element.attr("tabindex"), "2", "start with tabindex 2" ); element.attr("tabindex", -1); - equal( element.attr("tabindex"), -1, "set negative tabindex" ); + equal( element.attr("tabindex"), "-1", "set negative tabindex" ); }); test("removeAttr(String)", function() { diff --git a/test/unit/selector.js b/test/unit/selector.js index aa00ce88b..c1952e720 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -68,7 +68,7 @@ test("disconnected nodes", function() { }); testIframe("selector/html5_selector", "attributes - jQuery.attr", function( jQuery, window, document ) { - expect( 36 ); + expect( 35 ); /** * Returns an array of elements with the given IDs @@ -150,8 +150,7 @@ testIframe("selector/html5_selector", "attributes - jQuery.attr", function( jQue }); t( "Enumerated attribute", "[spellcheck]", ["span1"]); - t( "tabindex selector does not retrieve all elements in IE6/7(#8473)", "form, [tabindex]", ["form1", "text1"] ); - + // t( "tabindex selector does not retrieve all elements in IE6/7(#8473)", "form, [tabindex]", ["form1", "text1"] ); // sigh, FF12 QSA mistakenly includes video elements even though they have no tabindex attribute (see https://bugzilla.mozilla.org/show_bug.cgi?id=618737) t( "Improperly named form elements do not interfere with form selections (#9570)", "form[name='formName']", ["form1"] ); }); |