Comfy-Org / Comfy-Org/ComfyUI_frontend

test: add undo/redo browser test for nested subgraph packing with promotions

Open
#10,552 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
area:subgraph area:testing area:undo-redo
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Summary

Add a browser/integration test verifying that undo and redo work correctly after packing interior nodes into a nested subgraph when the host `SubgraphNode` has promoted widgets.

## Background

PR #10532 introduced `_repointAncestorPromotions`, which calls `store.promote()` and `setPromotions()` inside `_convertToSubgraphImpl`. The outer `convertToSubgraph` method wraps the operation with `beforeChange()` / `afterChange()`, but whether these wrappers correctly snapshot the Pinia promotion store mutations for undo/redo has not been audited.

A manual undo/redo smoke test was recommended before merging #10532, and a regression test should be added in a follow-up PR to prevent future regressions.

## Acceptance Criteria

- [ ] A Playwright browser test (or equivalent integration test) that:
1. Loads a workflow with a host `SubgraphNode` that has at least one promoted widget.
2. Enters the subgraph, selects interior nodes, and calls `convertToSubgraph` to pack them into a nested subgraph.
3. Asserts promoted widget values on the host node are preserved after packing.
4. Performs **undo** and asserts the promoted widget values and promotion store entries are correctly restored to their pre-pack state.
5. Performs **redo** and asserts the state is correctly re-applied.

## References

- PR: #10532 (introduces `_repointAncestorPromotions`)
- Related issue: #10542 (test cleanup for PR #10532)
- Comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10532#discussion_r2992114607
- Requested by: @christian-byrne

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10552-test-add-undo-redo-browser-test-for-nested-subgraph-packing-with-promotions-32f6d73d365081e4addced0670f59e4c) 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.