Tests update

This commit is contained in:
Francisco Hodge 2019-01-17 18:36:19 -05:00
parent 1f9efb0c66
commit c59f819db9

View File

@ -598,6 +598,42 @@ it('Keyboard caretEventHandler will detect input, textarea focus', () => {
expect(keyboard.caretPosition).toBe(3); expect(keyboard.caretPosition).toBe(3);
}); });
it('Keyboard caretEventHandler will not set caretPosition on disableCaretPositioning', () => {
testUtil.setDOM();
let keyboard = new Keyboard();
keyboard.caretEventHandler({
charCode: 0,
code: "KeyF",
key: "f",
which: 70,
target: {
tagName: "input",
selectionStart: 3
}
});
expect(keyboard.caretPosition).toBe(3);
keyboard.setOptions({
disableCaretPositioning: true
});
keyboard.caretEventHandler({
charCode: 0,
code: "KeyF",
key: "f",
which: 70,
target: {
tagName: "input",
selectionStart: 3
}
});
expect(keyboard.caretPosition).toBeFalsy();
});
it('Keyboard caretEventHandler ignore positioning if input, textarea is blur', () => { it('Keyboard caretEventHandler ignore positioning if input, textarea is blur', () => {
testUtil.setDOM(); testUtil.setDOM();