Skip to content

Commit 1729e3a

Browse files
committed
Core: Added tests for :focusable and :tabbable form elements.
1 parent 18a3b53 commit 1729e3a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

tests/unit/core/core.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ <h2 id="qunit-userAgent"></h2>
4646
<area shape="rect" coords="1,1,2,2" href="foo.html" id="areaNoImg">
4747
</map>
4848

49+
<form id="formNoTabindex"></form>
50+
<form id="formTabindex" tabindex="1"></form>
51+
4952
<div>
5053
<input id="visibleAncestor-inputTypeNone">
5154
<input type="text" id="visibleAncestor-inputTypeText">

tests/unit/core/selector.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ test("data", function() {
7979
});
8080

8181
test("focusable - visible, enabled elements", function() {
82-
expect(16);
82+
expect(18);
8383

84+
isNotFocusable('#formNoTabindex', 'form');
85+
isFocusable('#formTabindex', 'form with tabindex');
8486
isFocusable('#visibleAncestor-inputTypeNone', 'input, no type');
8587
isFocusable('#visibleAncestor-inputTypeText', 'input, type text');
8688
isFocusable('#visibleAncestor-inputTypeCheckbox', 'input, type checkbox');
@@ -156,8 +158,10 @@ test("focusable - area elements", function() {
156158
});
157159

158160
test("tabbable - visible, enabled elements", function() {
159-
expect(16);
161+
expect(18);
160162

163+
isNotTabbable('#formNoTabindex', 'form');
164+
isTabbable('#formTabindex', 'form with tabindex');
161165
isTabbable('#visibleAncestor-inputTypeNone', 'input, no type');
162166
isTabbable('#visibleAncestor-inputTypeText', 'input, type text');
163167
isTabbable('#visibleAncestor-inputTypeCheckbox', 'input, type checkbox');

0 commit comments

Comments
 (0)