Merge pull request #14489 from calixteman/14488

Fix scripting test related to keystroke event
This commit is contained in:
calixteman 2022-01-24 17:43:25 +01:00 committed by GitHub
commit 414a4d873a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1168,11 +1168,25 @@ describe("Scripting", function () {
value: "3F?",
change: "0",
name: "Keystroke",
willCommit: true,
willCommit: false,
selStart: 3,
selEnd: 3,
});
expect(send_queue.has(refId)).toEqual(false);
await sandbox.dispatchEventInSandbox({
id: refId,
value: "3F?0",
name: "Keystroke",
willCommit: true,
selStart: 4,
selEnd: 4,
});
expect(send_queue.has(refId)).toEqual(true);
expect(send_queue.get(refId)).toEqual({
id: refId,
valueAsString: "3F?0",
});
});
});