Comfy-Org / Comfy-Org/ComfyUI_frontend
test: add negative name assertions in slot label priority fallback tests
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Summary
When testing label priority fallback logic in slot rendering (e.g., `label` → `localized_name` → `name`), tests should assert **both** that the expected label is rendered *and* that lower-priority names are **not** rendered. This ensures the fallback priority is correctly implemented and prevents regressions.
## Motivation
In PR #10013 (comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10013#discussion_r2951861863), reviewer @Myestery suggested adding a negative assertion for `name` when `localized_name` is the expected output. The specific instance in `OutputSlot.test.ts` was fixed in commit 42533ad. However, the same pattern should be audited and applied consistently across all slot/node label rendering tests in the codebase.
## Scope
- Review all existing tests that exercise label priority fallback (e.g., `InputSlot.test.ts`, `OutputSlot.test.ts`, `SubgraphNode.test.ts`, and any similar files).
- For each fallback test case, add a complementary negative assertion (e.g., `expect(wrapper.text()).not.toContain('internal_name')`) to confirm lower-priority values are not leaked into the rendered output.
- Ensure the pattern is applied uniformly: when `label` is set, assert `localized_name` and `name` are absent; when only `localized_name` is set, assert `name` is absent.
## References
- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10013
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/10013#discussion_r2951861863
- Requested by: @christian-byrne
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-10523-test-add-negative-name-assertions-in-slot-label-priority-fallback-tests-32e6d73d365081fda5a2c380e0d2ec83) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.