Comfy-Org / Comfy-Org/ComfyUI_frontend

Make LocateNodeButton keyboard activation test focus the button explicitly

Open
#14,786 1 comment 1 reaction 1 assignee Claimed by @christian-byrne View on GitHub
area:testing PrimeVue
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.