Comfy-Org / Comfy-Org/ComfyUI_frontend

Clean up tests introduced in PR #10532 (nested subgraph packing)

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

Description

## Summary

PR #10532 (https://github.com/Comfy-Org/ComfyUI_frontend/pull/10532) introduced two new test files to cover the `_repointAncestorPromotions` / nested-subgraph-packing fix. A follow-up cleanup pass is needed on both files.

## Files to clean up

### 1. `src/lib/litegraph/src/LGraph.repointAncestorPromotions.test.ts`

- Dynamic node-type registration and cleanup is verbose; consider extracting a shared helper or test-fixture function.
- Three test cases share significant setup boilerplate (Pinia init, fixture state, type registration) that could be consolidated into a `beforeEach` or factory helper.
- Assertion style could be made more consistent across the three cases.

### 2. `browser_tests/tests/subgraphNestedPackValues.spec.ts`

- The two tests duplicate the load → enter → disable-Vue-nodes → select-all → `convertToSubgraph` → exit flow; extract into a shared helper.
- The `evaluate` block that filters `proxyWidgets` and resolves node IDs is complex inline browser JS; move logic into a well-named page-object method or helper.
- The `toPass` retry block (5 s timeout) wraps multiple assertions; consider splitting into focused individual retryable checks.
- Role-based locator strategy (`getByRole('textbox', { name: 'prompt' })`) introduced in the latest commit is good — ensure all other widget locators follow the same pattern instead of using positional selectors.
- Remove any leftover `console.log` / debug statements before merging cleanup.

## Requested by

@DrJKL in https://github.com/Comfy-Org/ComfyUI_frontend/pull/10532

## References

- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10532

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10542-Clean-up-tests-introduced-in-PR-10532-nested-subgraph-packing-32f6d73d36508160820cfde54c316df5) 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.