Comfy-Org / Comfy-Org/ComfyUI_frontend

test: add shiftKey to boundary reorder tests in ComfyHubExamplesStep

Open
#10,464 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
area:testing
Dominant language
TypeScript
Stars
2k
Forks
702
Avg merge
1d 8h
Merged PRs (30d)
512

Description

## Follow-up: Fix boundary reorder tests in `ComfyHubExamplesStep.test.ts`

**Context:**
Commit `2cf8e64` fixed the positive keyboard-reorder tests (adding `shiftKey: true`) in `src/platform/workflow/sharing/components/publish/ComfyHubExamplesStep.test.ts`, but the two boundary tests were missed.

**Problem:**
The boundary tests currently send plain `ArrowLeft`/`ArrowRight` key events **without** `shiftKey: true`. Because plain arrow keys trigger focus movement (not reorder logic), these tests pass trivially — they are validating focus-movement boundary behavior rather than the intended reorder boundary behavior.

**Fix:**
Update both boundary tests to include `shiftKey: true` so they exercise the actual reorder path and correctly assert that no `update:exampleImages` event is emitted at the list boundaries:

```diff
- await tiles[0].trigger('keydown', { key: 'ArrowLeft' })
+ await tiles[0].trigger('keydown', { key: 'ArrowLeft', shiftKey: true })
...
- await tiles[2].trigger('keydown', { key: 'ArrowRight' })
+ await tiles[2].trigger('keydown', { key: 'ArrowRight', shiftKey: true })
```

**File:** `src/platform/workflow/sharing/components/publish/ComfyHubExamplesStep.test.ts` (~lines 68 and 77)

**References:**
- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10128
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10128#discussion_r2943928038
- Requested by: @christian-byrne

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10464-test-add-shiftKey-to-boundary-reorder-tests-in-ComfyHubExamplesStep-32d6d73d3650815ab9a7f0d702192758) by [Unito](https://www.unito.io)

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.