Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/provider/native/libnut-keyboard-action.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
26 changes: 26 additions & 0 deletions lib/provider/native/libnut-keyboard.action.class.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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", []);
});
});
});