Skip to content

Commit ad0e5f7

Browse files
helen-dikarevaAlexanderMoskovkin
authored andcommittedSep 21, 2017
link without href but with tabIndex included in nextFocusable method's logic (closes DevExpress#1803) (DevExpress#1807)
1 parent 0bc45fd commit ad0e5f7

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed
 

‎test/client/fixtures/automation/tab-emulation-test.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
var hammerhead = window.getTestCafeModule('hammerhead');
22
var browserUtils = hammerhead.utils.browser;
33

4-
var testCafeCore = window.getTestCafeModule('testCafeCore');
5-
var domUtils = testCafeCore.get('./utils/dom');
4+
var testCafeCore = window.getTestCafeModule('testCafeCore');
5+
var domUtils = testCafeCore.get('./utils/dom');
66

77
var testCafeAutomation = window.getTestCafeModule('testCafeAutomation');
88
var PressAutomation = testCafeAutomation.Press;
@@ -21,6 +21,7 @@ $(document).ready(function () {
2121
var $inputText = null;
2222
var $textarea = null;
2323
var $link = null;
24+
var $linkWithTabIndex = null;
2425
var $divWithTabIndex = null;
2526

2627
//contentEditable elements
@@ -48,11 +49,13 @@ $(document).ready(function () {
4849
var createElements = function () {
4950
var $body = $('body');
5051

51-
$inputText = $('<input type="text">').attr('value', 'text input').addClass(TEST_ELEMENT_CLASS).appendTo($body);
52-
$textarea = $('<textarea>').css('height', 100).attr('value', 'textarea').addClass(TEST_ELEMENT_CLASS).appendTo($body);
53-
$link = $('<a>').attr('href', 'http://www.example.org/').attr('tabIndex', 2).text('Link with href').addClass(TEST_ELEMENT_CLASS).appendTo($body);
52+
$inputText = $('<input type="text">').attr('value', 'text input').addClass(TEST_ELEMENT_CLASS).appendTo($body);
53+
$textarea = $('<textarea>').css('height', 100).attr('value', 'textarea').addClass(TEST_ELEMENT_CLASS).appendTo($body);
54+
$link = $('<a>').attr('href', 'http://www.example.org/').attr('tabIndex', 2).text('Link with href').addClass(TEST_ELEMENT_CLASS).appendTo($body);
55+
$linkWithTabIndex = $('<a>').attr('tabIndex', '0').text('Link without href but with tabIndex').addClass(TEST_ELEMENT_CLASS).appendTo($body);
5456

5557
$('<a>').text('Link without href').addClass(TEST_ELEMENT_CLASS).appendTo($body);
58+
$('<a>').attr('tabIndex', '-10').text('Link without href and with negative tabIndex').addClass(TEST_ELEMENT_CLASS).appendTo($body);
5659
$('<div></div>').text('div tag').addClass(TEST_ELEMENT_CLASS).appendTo($body);
5760

5861
$divWithTabIndex = $('<div></div>').text('div tag with tabIndex').attr('tabIndex', 1).addClass(TEST_ELEMENT_CLASS).appendTo($body);
@@ -111,6 +114,9 @@ $(document).ready(function () {
111114
$expectedFocusedElements.push($inputText);
112115
$expectedFocusedElements.push($textarea);
113116

117+
//GH-1803
118+
$expectedFocusedElements.push($linkWithTabIndex);
119+
114120
$expectedFocusedElements.push($divContentEditable);
115121

116122
$expectedFocusedElements.push($inputSubmit);

0 commit comments

Comments
 (0)
Please sign in to comment.