mirror of
https://github.com/Mintplex-Labs/nut.js.git
synced 2026-07-19 22:15:20 -04:00
(#260) Added missing lookup for 'delete' key
This commit is contained in:
@@ -101,7 +101,7 @@ export default class KeyboardAction implements KeyboardActionProvider {
|
||||
[Key.Print, "printscreen"],
|
||||
[Key.Pause, null],
|
||||
[Key.Insert, "insert"],
|
||||
[Key.Delete, null],
|
||||
[Key.Delete, "delete"],
|
||||
[Key.Home, "home"],
|
||||
[Key.End, "end"],
|
||||
[Key.PageUp, "pageup"],
|
||||
|
||||
@@ -175,4 +175,30 @@ describe("libnut keyboard action", () => {
|
||||
expect(SUT.releaseKey(Key.A)).rejects.toThrowError("Test error");
|
||||
});
|
||||
});
|
||||
|
||||
describe("bugfix #260", () => {
|
||||
it("should forward the pressKey call to libnut for 'delete'", () => {
|
||||
// GIVEN
|
||||
const SUT = new KeyboardAction();
|
||||
|
||||
// WHEN
|
||||
SUT.pressKey(Key.Delete);
|
||||
|
||||
// THEN
|
||||
expect(libnut.keyToggle).toBeCalledTimes(1);
|
||||
expect(libnut.keyToggle).toBeCalledWith("delete", "down", []);
|
||||
});
|
||||
|
||||
it("should forward the releaseKey call to libnut for 'delete'", () => {
|
||||
// GIVEN
|
||||
const SUT = new KeyboardAction();
|
||||
|
||||
// WHEN
|
||||
SUT.releaseKey(Key.Delete);
|
||||
|
||||
// THEN
|
||||
expect(libnut.keyToggle).toBeCalledTimes(1);
|
||||
expect(libnut.keyToggle).toBeCalledWith("delete", "up", []);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user