Renderer tests for keyboard shortcuts and dialogs

Open
#95 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
76/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
electron, node.js, react, typescript

Research direction

Start with vitest.config.mts and the existing renderer tests under tests/renderer/**, then review mockApi.ts to see how window.vmm is provided. Add a DOM test environment and React Testing Library, following the setup patterns already used by the project. Done means renderer tests cover arrow-key focus boundaries, shortcuts being disabled for open dialogs, Delete being ignored while typing or running a VM, and Modal Esc invoking the current onClose.

Written by the indexing model from the issue text.

Description

tests

The unit tests run in node without a DOM, so none of the renderer's key handling has tests. #89 only tests filterVms. Things that broke or nearly broke in review and would be worth pinning down:

  • arrows only move through the library with focus inside it (#89 review)
  • shortcuts are ignored while a dialog is open
  • Delete is ignored while typing and while the VM runs
  • Modal's Esc uses the current onClose

A jsdom (or happy-dom) project in vitest.config.mts for tests/renderer/** plus React Testing Library, with the browser mock from mockApi.ts as window.vmm, should be enough.

Dominant language
TypeScript
Stars
3
Forks
0
Avg merge
2m
Merged PRs (30d)
59

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from A21-devs/Virtual-Machine-Manager

All issues in A21-devs/Virtual-Machine-Manager

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.