Address physicalKeyboardHighlight issue on older browsers. Fixes #1035

This commit is contained in:
Francisco Hodge
2021-05-16 22:40:31 -07:00
parent c2d9cc0f3f
commit b993885bd5
10 changed files with 851 additions and 753 deletions
@@ -201,4 +201,25 @@ it('PhysicalKeyboard with physicalKeyboardHighlightPress can trigger noop', () =
tagName: "input"
}
}));
});
it('PhysicalKeyboard keyCodeToKey will work', () => {
setDOM();
const keyboard = new Keyboard({
physicalKeyboardHighlight: true
});
expect(keyboard.physicalKeyboard.keyCodeToKey(186)).toBe(";");
const methodTest = spyOn(keyboard.physicalKeyboard, "keyCodeToKey");
document.dispatchEvent(new KeyboardEvent('keyup', {
keyCode: 186,
target: {
tagName: "input"
}
}));
expect(methodTest).toBeCalledWith(186);
});