diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2009-09-15 08:35:46 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2009-09-15 08:35:46 +0000 |
commit | 09fd7fc1fa204a63bc3929eac5f082a599bab0d0 (patch) | |
tree | eed8cd1961594446b1493826d1636ba91d3a4b37 /tests | |
parent | b9b604936e29c3d6a5a50f75460eb3c98ee80f30 (diff) | |
download | jquery-ui-09fd7fc1fa204a63bc3929eac5f082a599bab0d0.tar.gz jquery-ui-09fd7fc1fa204a63bc3929eac5f082a599bab0d0.zip |
core tests: a few comments about failing tests, a few fixes for existing tests, mostly messages; primary remaining issue is that both $("area").is(":visible") and $("area").is(":hidden") return true, which is most likely a bug in jQuery core
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/core/core.html | 14 | ||||
-rw-r--r-- | tests/unit/core/selector.js | 16 |
2 files changed, 17 insertions, 13 deletions
diff --git a/tests/unit/core/core.html b/tests/unit/core/core.html index f3115ca4f..6be62130b 100644 --- a/tests/unit/core/core.html +++ b/tests/unit/core/core.html @@ -24,22 +24,22 @@ <input type="radio" id="visibleAncestor-inputTypeRadio" /> <input type="button" id="visibleAncestor-inputTypeButton" /> <input type="hidden" id="visibleAncestor-inputTypeHidden" /> - <button id="visibleAncestor-button"></button> + <button id="visibleAncestor-button">x</button> <select id="visibleAncestor-select"> <option>option</option> </select> - <textarea id="visibleAncestor-textarea"></textarea> - <object id="visibleAncestor-object"></object> + <textarea id="visibleAncestor-textarea">x</textarea> + <object id="visibleAncestor-object">xxx</object> <a href="#" id="visibleAncestor-anchorWithHref">anchor</a> <a id="visibleAncestor-anchorWithoutHref">anchor</a> <map> <area href="#" id="visibleAncestor-areaWithHref" alt="" /> <area id="visibleAncestor-areaWithoutHref" alt="" /> </map> - <span id="visibleAncestor-span"></span> - <div id="visibleAncestor-div"></div> - <span id="visibleAncestor-spanWithTabindex" tabindex="1"></span> - <div id="visibleAncestor-divWithNegativeTabindex" tabindex="-1"></div> + <span id="visibleAncestor-span">x</span> + <div id="visibleAncestor-div">x</div> + <span id="visibleAncestor-spanWithTabindex" tabindex="1">x</span> + <div id="visibleAncestor-divWithNegativeTabindex" tabindex="-1">x</div> </div> <div> diff --git a/tests/unit/core/selector.js b/tests/unit/core/selector.js index 6e70b5849..269b77e08 100644 --- a/tests/unit/core/selector.js +++ b/tests/unit/core/selector.js @@ -6,19 +6,19 @@ module("core - selectors"); function isFocusable(selector, msg) { - ok($(selector).is(':focusable'), msg); + ok($(selector).is(':focusable'), msg + " - selector " + selector + " is focusable"); } function isNotFocusable(selector, msg) { - ok($(selector).length && !$(selector).is(':focusable'), msg); + ok($(selector).length && !$(selector).is(':focusable'), msg + " - selector " + selector + " is not focusable"); } function isTabbable(selector, msg) { - ok($(selector).is(':tabbable'), msg); + ok($(selector).is(':tabbable'), msg + " - selector " + selector + " is tabbable"); } function isNotTabbable(selector, msg) { - ok($(selector).length && !$(selector).is(':tabbable'), msg); + ok($(selector).length && !$(selector).is(':tabbable'), msg + " - selector " + selector + " is not tabbable"); } test("data", function() { @@ -93,6 +93,7 @@ test("focusable - visible, enabled elements", function() { isFocusable('#visibleAncestor-object', 'object'); isFocusable('#visibleAncestor-anchorWithHref', 'anchor with href'); isNotFocusable('#visibleAncestor-anchorWithoutHref', 'anchor without href'); + // fails: $("map").is(":visible") and $("map").is(":hidden") both return true isFocusable('#visibleAncestor-areaWithHref', 'area with href'); isNotFocusable('#visibleAncestor-areaWithoutHref', 'area without href'); isNotFocusable('#visibleAncestor-span', 'span'); @@ -131,7 +132,7 @@ test("focusable - hidden styles", function() { isNotFocusable('#visibilityHidden-span', 'span with tabindex, visibility: hidden'); }); -test("focusable - natively tabbable with various tabindex", function() { +test("focusable - natively focusable with various tabindex", function() { expect(4); isFocusable('#inputTabindex0', 'input, tabindex 0'); @@ -140,7 +141,7 @@ test("focusable - natively tabbable with various tabindex", function() { isFocusable('#inputTabindex-50', 'input, tabindex -50'); }); -test("focusable - not natively tabbable with various tabindex", function() { +test("focusable - not natively focusable with various tabindex", function() { expect(4); isFocusable('#spanTabindex0', 'span, tabindex 0'); @@ -173,6 +174,7 @@ test("tabbable - visible, enabled elements", function() { isTabbable('#visibleAncestor-object', 'object'); isTabbable('#visibleAncestor-anchorWithHref', 'anchor with href'); isNotTabbable('#visibleAncestor-anchorWithoutHref', 'anchor without href'); + // fails: $("map").is(":visible") and $("map").is(":hidden") both return true isTabbable('#visibleAncestor-areaWithHref', 'area with href'); isNotTabbable('#visibleAncestor-areaWithoutHref', 'area without href'); isNotTabbable('#visibleAncestor-span', 'span'); @@ -201,10 +203,12 @@ test("Tabbable - hidden styles", function() { isNotTabbable('#displayNoneAncestor-input', 'input, display: none parent'); isNotTabbable('#displayNoneAncestor-span', 'span with tabindex, display: none parent'); + // fails: element hidden by parent-visibility-hidden is still visible according to :visible isNotTabbable('#visibilityHiddenAncestor-input', 'input, visibility: hidden parent'); isNotTabbable('#visibilityHiddenAncestor-span', 'span with tabindex, visibility: hidden parent'); isNotTabbable('#displayNone-input', 'input, display: none'); + // fails: element hidden by parent-visibility-hidden is still visible according to :visible isNotTabbable('#visibilityHidden-input', 'input, visibility: hidden'); isNotTabbable('#displayNone-span', 'span with tabindex, display: none'); |