Show popout when press printable character

This commit is contained in:
David Cook
2024-02-01 11:14:11 +11:00
parent da82b12ca7
commit 133a9e6c7f
2 changed files with 25 additions and 4 deletions

View File

@@ -42,7 +42,21 @@ describe("PopoutController", () => {
expectToBeShown(dialog);
});
it("doesn't show the dialog on other key press (tab)", () => {
it("shows and updates on number press", () => {
button.dispatchEvent(new KeyboardEvent("keydown", { key: "1" }));
expectToBeShown(dialog);
expect(input1.value).toBe("1");
});
it("shows and updates on character press", () => {
button.dispatchEvent(new KeyboardEvent("keydown", { key: "a" }));
expectToBeShown(dialog);
expect(input1.value).toBe("a");
});
it("doesn't show the dialog on control key press (tab)", () => {
button.dispatchEvent(new KeyboardEvent("keydown", { keyCode: 9 }));
expectToBeClosed(dialog);