iron-test-helpers
iron-test-helpers copied to clipboard
Allow a MockInteractions.pressAndReleaseKeyOn alternative that takes a keyIdentifier
MockInteractions.pressAndReleaseKeyOn(element, 221); // ']'
Will fail because the custom event doesn’t have a keyIdentifier and the keyCode lies outside of what is present in KEY_CODE within https://github.com/PolymerElements/iron-a11y-keys-behavior/blob/master/iron-a11y-keys-behavior.html
A workaround for now has been to create my own function pressAndReleaseKeyIdenfitifierOn(element, '\U+005D') which sets the keyIdentifier which is then recognized by iron-a11y-keys-behavior via transformKeyIdentifier.