-
Notifications
You must be signed in to change notification settings - Fork 674
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into bitbucket-fix
- Loading branch information
Showing
4 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
test/functional/fixtures/regression/gh-8321/pages/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
</head> | ||
<body> | ||
<div contenteditable="true"> | ||
<div id="myText">example</div> | ||
</div> | ||
</body> | ||
<script> | ||
const element = document.getElementById("myText"); | ||
element.addEventListener("click", () => { | ||
const selection = document.getSelection(); | ||
const range = document.createRange(); | ||
|
||
range.selectNodeContents(element); | ||
range.collapse(false); | ||
selection.removeAllRanges(); | ||
selection.addRange(range); | ||
}); | ||
</script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
describe('[Regression](GH-8321)', function () { | ||
it('Should type text without errors when document selection is updated', function () { | ||
return runTests('testcafe-fixtures/index.js', 'Callsite Issue', { only: 'chrome' }); | ||
}); | ||
}); |
11 changes: 11 additions & 0 deletions
11
test/functional/fixtures/regression/gh-8321/testcafe-fixtures/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Selector } from 'testcafe'; | ||
|
||
fixture('GH-8321 - Callsite Issue') | ||
.page`http://localhost:3000/fixtures/regression/gh-8321/pages/index.html`; | ||
|
||
test('Callsite Issue', async t => { | ||
const editor = Selector('[contenteditable=true]'); | ||
|
||
await t.click(editor); | ||
await t.typeText(editor, 'text1'); | ||
}); |