mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-31 09:09:53 -04:00
FIX: Test in phantom environment with different selection defaults
This commit is contained in:
parent
146ec4e1ba
commit
4aab904ff6
1 changed files with 5 additions and 1 deletions
|
@ -43,6 +43,10 @@ test("Tests the Composer controls", () => {
|
|||
});
|
||||
|
||||
andThen(() => {
|
||||
const textarea = find('#reply-control .d-editor-input')[0];
|
||||
textarea.selectionStart = textarea.value.length;
|
||||
textarea.selectionEnd = textarea.value.length;
|
||||
|
||||
// Testing keyboard events is tough!
|
||||
const mac = /Mac|iPod|iPhone|iPad/.test(navigator.platform);
|
||||
const event = document.createEvent('Event');
|
||||
|
@ -50,7 +54,7 @@ test("Tests the Composer controls", () => {
|
|||
event[mac ? 'metaKey' : 'ctrlKey'] = true;
|
||||
event.keyCode = 66;
|
||||
|
||||
find('#reply-control .d-editor-input')[0].dispatchEvent(event);
|
||||
textarea.dispatchEvent(event);
|
||||
});
|
||||
|
||||
andThen(() => {
|
||||
|
|
Loading…
Add table
Reference in a new issue