Comfy-Org / Comfy-Org/ComfyUI_frontend
test: use expect.any(Boolean) instead of hardcoded false for mediaScanSpy cloud-flag assertion
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Follow-up from PR #11908
In `src/composables/graph/useErrorClearingHooks.test.ts`, the `'skips nested subgraph containers during parent subgraph replay scan'` test asserts a hardcoded `false` as the third argument to `mediaScanSpy` (the cloud-flag parameter). While this is currently deterministic in CI (localhost distribution), coupling the spec to a runtime distribution mode value could cause flakiness in Cloud-configured runs.
**Suggested change:** Replace the two hardcoded `false` assertions for `mediaScanSpy` with `expect.any(Boolean)` so the test focuses on node-selection behavior rather than the cloud flag.
```diff
- expect(mediaScanSpy).toHaveBeenCalledWith(rootGraph, leafNode, false)
+ expect(mediaScanSpy).toHaveBeenCalledWith(
+ rootGraph,
+ leafNode,
+ expect.any(Boolean)
+ )
expect(mediaScanSpy).not.toHaveBeenCalledWith(
rootGraph,
innerSubgraphNode,
- false
+ expect.any(Boolean)
)
```
**Context:**
- PR: https://github.com/Comfy-Org/ComfyUI_frontend/pull/11908
- Review comment: https://github.com/Comfy-Org/ComfyUI_frontend/pull/11908#discussion_r3188112617
- Requested by: @jaeone94
┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-11961-test-use-expect-any-Boolean-instead-of-hardcoded-false-for-mediaScanSpy-cloud-flag--3576d73d365081c5b0cec1576a98280b) by [Unito](https://www.unito.io)
Contributor guide
Assessment
This issue has not been assessed yet.