Comfy-Org / Comfy-Org/ComfyUI_frontend

Test locate emission with click propagation in LocateNodeButton

Open
#14,785 1 comment 1 reaction 1 assignee Claimed by @christian-byrne View on GitHub
area:testing
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Summary

Strengthen the click-propagation test for `LocateNodeButton`.

## Required change

Update `src/components/rightSidePanel/errors/LocateNodeButton.test.ts` so the propagation test registers both:

- An ancestor `@click` handler.
- A `@locate` handler on `LocateNodeButton`.

After one user click on `LocateNodeButton`, verify that the `locate` handler runs once and that the ancestor click handler does not run.

## Rationale

The current test verifies only that click propagation stops. A handler that stops propagation without emitting `locate` would still pass that test. The follow-up test must verify both parts of the component contract in the same interaction.

## Affected area

- `src/components/rightSidePanel/errors/LocateNodeButton.test.ts`

## Acceptance criteria

- The propagation test attaches an `@locate` listener.
- A button click invokes the `locate` listener exactly once.
- The same click does not invoke the ancestor click handler.
- The existing locate-button test suite remains valid.

## Backlinks

- Pull request: https://github.com/Comfy-Org/ComfyUI_frontend/pull/13401
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/13401#discussion_r3634946903

Requested by: @christian-byrne

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.