mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-23 06:17:44 +00:00
feat(web): bounds check unit test
This commit is contained in:
parent
94b10a0e76
commit
6a16b45b63
1 changed files with 10 additions and 0 deletions
|
|
@ -31,6 +31,7 @@ if(typeof InterfaceTests == 'undefined') {
|
|||
|
||||
InterfaceTests.Input.resetWithText = function(pair, string) {
|
||||
pair.elem.value = string;
|
||||
pair.wrapper.invalidateSelection();
|
||||
pair.elem.setSelectionRange(0, 0);
|
||||
}
|
||||
|
||||
|
|
@ -76,6 +77,7 @@ if(typeof InterfaceTests == 'undefined') {
|
|||
|
||||
InterfaceTests.TextArea.resetWithText = function(pair, string) {
|
||||
pair.elem.value = string;
|
||||
pair.wrapper.invalidateSelection();
|
||||
pair.elem.setSelectionRange(0, 0);
|
||||
}
|
||||
|
||||
|
|
@ -803,6 +805,14 @@ if(typeof InterfaceTests == 'undefined') {
|
|||
pair.wrapper.deleteCharsBeforeCaret(2);
|
||||
assert.equal(pair.wrapper.getText(), Apple.mixed.substr(0, 1) + Apple.mixed.substr(4), "Error deleting context chars from a mixed SMP string");
|
||||
String.kmwEnableSupplementaryPlane(false);
|
||||
|
||||
String.kmwEnableSupplementaryPlane(false);
|
||||
testObj.resetWithText(pair, Apple.normal);
|
||||
testObj.setCaret(pair, 4);
|
||||
pair.wrapper.deleteCharsBeforeCaret(7);
|
||||
assert.equal(pair.wrapper.getText(), "e", "Bounds-check on deletion range failed; context improperly deleted.");
|
||||
String.kmwEnableSupplementaryPlane(false);
|
||||
pair.wrapper.invalidateSelection();
|
||||
}
|
||||
|
||||
InterfaceTests.Tests.deleteCharsBeforeCaretWithSelection = function(testObj) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue