Comfy-Org / Comfy-Org/ComfyUI_frontend
Make LocateNodeButton keyboard activation test focus the button explicitly
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
Make the `LocateNodeButton` keyboard-activation test explicitly focus the rendered button before it sends the `Enter` key.
## Rationale
The current test uses `user.tab()` and relies on the JSDOM implicit tab order. The test has a single focusable element today, but an additional focusable element in the PrimeVue button structure could cause the test to activate the wrong element.
## Affected area
- `src/components/rightSidePanel/errors/LocateNodeButton.test.ts`
- The `emits locate on keyboard activation` test
## Required change
Get the button by its accessible role and name, call `.focus()` on it, then send `{Enter}` with `user.keyboard()`.
## Acceptance criteria
- The test explicitly focuses the `LocateNodeButton` before keyboard activation.
- Pressing `Enter` emits `locate` exactly once.
- The test continues to select the button by its accessible role and name.
## Context
Requested by @christian-byrne as a non-blocking follow-up from pull request #13401.
- Pull request: https://github.com/Comfy-Org/ComfyUI_frontend/pull/13401
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/13401#discussion_r3634946910
Contributor guide
Assessment
This issue has not been assessed yet.