mirror of
https://github.com/outline/outline.git
synced 2026-11-20 21:23:06 +03:00
* chore: Vendorize is-printable-key-event and styled-normalize * chore: Retain MIT notices for vendored normalize CSS
27 lines
598 B
TypeScript
27 lines
598 B
TypeScript
import { isPrintableKeyEvent } from "./keyboard";
|
|
|
|
describe("isPrintableKeyEvent", () => {
|
|
it("should return true for character keys", () => {
|
|
for (const key of ["a", "A", "1", " ", "/", "é", "😀", "ß"]) {
|
|
expect(isPrintableKeyEvent({ key })).toBe(true);
|
|
}
|
|
});
|
|
|
|
it("should return false for named keys", () => {
|
|
for (const key of [
|
|
"Enter",
|
|
"Tab",
|
|
"Shift",
|
|
"Backspace",
|
|
"ArrowLeft",
|
|
"Escape",
|
|
"Dead",
|
|
"F1",
|
|
"F24",
|
|
"Unidentified",
|
|
]) {
|
|
expect(isPrintableKeyEvent({ key })).toBe(false);
|
|
}
|
|
});
|
|
});
|