Comfy-Org / Comfy-Org/ComfyUI_frontend

test(changeTracker): add regression test for multilineOrOptions forwarding in wrapped prompt

Open
#9,418 0 comments 0 reactions 1 assignee Claimed by @dante01yoon View on GitHub
area:testing developer experience
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Follow-up: Regression Test for `multilineOrOptions` Argument Forwarding

### Background

In PR #8985, a bugfix was applied to `src/scripts/changeTracker.ts` where the monkey-patched `LGraphCanvas.prototype.prompt` was silently dropping the fifth argument (`multilineOrOptions`). The fix correctly forwards this argument to the original `prompt` call.

### Problem

There is currently no regression test covering this fix. A future refactor could silently re-drop the `multilineOrOptions` argument, reintroducing the bug without any test failure.

### Task

Add a unit test in the `ChangeTracker` test suite (or a dedicated test file) that:

1. Wraps `LGraphCanvas.prototype.prompt` via `ChangeTracker.init()` (or the relevant setup path).
2. Calls the wrapped `prompt` with a `PromptOptions` object (e.g. `{ inputType: 'number', min: 0, max: 10 }`) as the fifth argument.
3. Asserts that the underlying original `prompt` receives the `multilineOrOptions` argument correctly (i.e. it is not `undefined` and matches the passed value).

### References

- PR: #8985
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/8985#discussion_r2886699341
- File: `src/scripts/changeTracker.ts`

Requested by @dante01yoon.

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-9418-test-changeTracker-add-regression-test-for-multilineOrOptions-forwarding-in-wrapped--31a6d73d36508148a0cade26b3045033) 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.