Skip to content

Commit

Permalink
test: typeText should work with the DX Lookup search field (#6236)
Browse files Browse the repository at this point in the history
  • Loading branch information
wentwrong committed Jul 12, 2021
1 parent 36d5b37 commit ac20da7
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/functional/fixtures/regression/gh-4472/pages/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>gh-4472</title>
</head>
<body>
<div id="targetInputWrapper">
<input type="text" id="targetInput" tabindex="0"></input>
</div>
<script>
var input = document.getElementById('targetInput');
var div = document.getElementById('targetInputWrapper');

input.onclick = function () {
div.focus();
};
</script>
</body>
</html>
5 changes: 5 additions & 0 deletions test/functional/fixtures/regression/gh-4472/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe('[Regression](GH-4472)', function () {
it('Input should not lose focus after the focus method was called on a not focusable element', function () {
return runTests('testcafe-fixtures/index.js');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Selector } from 'testcafe';

fixture `GH-4472`
.page `http://localhost:3000/fixtures/regression/gh-4472/pages/index.html`;

test(`Should not lose the focus on input`, async t => {
const input = Selector('#targetInput');

await t.typeText(input, 'text');
await t.expect(input.value).eql('text');
});

0 comments on commit ac20da7

Please sign in to comment.