Comfy-Org / Comfy-Org/ComfyUI_frontend
test: add multi-instance repoint test for _repointAncestorPromotions
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
Add a unit test to `src/lib/litegraph/src/LGraph.repointAncestorPromotions.test.ts` that covers the case where **two host `SubgraphNode` instances of the same subgraph definition** both have their promotions repointed by `_repointAncestorPromotions`.
## Motivation
The current test suite in PR #10532 does not cover a scenario where multiple host nodes share the same subgraph type ID. In `_repointAncestorPromotions`, the first instance's repoint mutates the promotion store before the second instance reads it. A dedicated multi-instance test would verify that this ordering dependency is handled safely and that both host nodes end up with correctly repointed promotion entries.
## Proposed Test Outline
- Create a parent subgraph with at least one interior node carrying a promoted widget.
- Register the subgraph node type and add **two** `SubgraphNode` host instances (same type) to the root graph, each with a promotion pointing to the interior node.
- Call `convertToSubgraph` on the interior node to pack it into a nested subgraph.
- Assert that **both** host nodes' promotion entries are repointed to the nested subgraph node, with `disambiguatingSourceNodeId` set to the original interior node ID.
- Assert neither host node has stale store entries referencing the moved node ID.
## References
- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10532
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10532#discussion_r2992114605
- Requested by: @christian-byrne
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10551-test-add-multi-instance-repoint-test-for-_repointAncestorPromotions-32f6d73d3650812ab2bfcd1dcf1c66ac) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.