mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
FIX: Test in phantom environment with different selection defaults
This commit is contained in:
parent
146ec4e1ba
commit
4aab904ff6
@ -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…
x
Reference in New Issue
Block a user