Repository navigation
test: subgraph integration contracts and expanded Playwright coverage - #10123
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds public subgraph inspection/navigation helpers and promoted-widget filters, expands many subgraph-focused tests, introduces a canvas reset during workflow load to avoid UI state leakage, and exposes a named viewport cache size constant used by subgraph navigation. Changes
Sequence Diagram(s)sequenceDiagram
participant App as ComfyApp
participant Loader as loadGraphData
participant Canvas as Canvas
participant Root as RootGraph
App->>Loader: initiate loadGraphData(workflow)
Loader->>Loader: prepare graph data & cleanup
Loader->>Canvas: setGraph(Root) %% reset canvas state
Canvas-->>Loader: canvas state reset
Loader->>App: continue graph configuration
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
🎭 Playwright: ✅ 661 passed, 0 failed · 2 flaky📊 Browser Reports
|
🎨 Storybook: ✅ Built — View Storybook |
There was a problem hiding this comment.
Actionable comments posted: 6
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@browser_tests/tests/subgraphLifecycle.spec.ts`:
- Around line 198-222: The test currently only checks that the subgraph node
count goes to zero; after unpacking you must also assert that no node still
carries pseudo-preview entries and that no DOM preview elements remain: call
getPseudoPreviewWidgets(comfyPage, '5') (or iterate over all nodes via
comfyPage.page.evaluate and check node.data or attributes for the
$$canvas-image-preview marker) and expect its length to be 0, and add a
DOM-level assertion ensuring document.querySelectorAll('$$canvas-image-preview')
(or the actual preview selector used in the app) returns length 0; apply the
same additional checks to the similar test at the other block (lines 224-243) so
both cover node data cleanup and DOM cleanup after graph.unpackSubgraph.
In `@browser_tests/tests/subgraphProgressClear.spec.ts`:
- Around line 114-122: Replace the direct assertion that checks
subgraphNode?.progress with a retrying assertion using expect(...).toPass();
specifically, wrap the comfyPage.page.evaluate call (which reads
window.app!.canvas.graph! and finds the subgraph node via the isSubgraphNode()
predicate) inside an async arrow passed to expect and call .toPass({ timeout:
5000 }) so the assertion retries until the progress is cleared (matching the
earlier pattern that uses .toPass({ timeout: 2_000 })).
In `@browser_tests/tests/subgraphPromotion.spec.ts`:
- Around line 556-573: The test currently only compares widget names
(beforeNames/afterNames) which misses cases where a different promoted node with
the same name is chosen; instead compare the full promoted-widget snapshot
returned by getPromotedWidgets() to ensure representative node IDs are
preserved. Replace the name-only assertions with a deep equality assertion
between beforeSnapshot and afterSnapshot (e.g.,
expect(afterSnapshot).toEqual(beforeSnapshot)), keeping or dropping the length
check as redundant; locate the comparison near the variables beforeSnapshot,
afterSnapshot, getPromotedWidgets, and the evaluate/loadGraphData calls.
In `@src/core/graph/subgraph/subgraphNodePromotion.test.ts`:
- Around line 332-334: Remove the unused local binding `store` from the test
named '3-level nested promotion resolves concrete widget type and value' by
deleting the `const store = usePromotionStore()` declaration; this eliminates
the unused-variable TS6133 error while leaving the rest of the test (and any
calls that rely on other bindings) unchanged—look for the test function with
that exact name and the `usePromotionStore` identifier to locate the line to
remove.
In `@src/stores/promotionStore.test.ts`:
- Around line 308-323: The test currently calls setPromotions twice but doesn't
exercise a single-step removal to catch double ref-counting; after calling
store.setPromotions(graphA, nodeId, entries) twice, invoke the single-step
removal API (prefer store.removePromotions(graphA, nodeId, entries) if it
exists; if not, keep using store.clearGraph(graphA) but ensure it represents a
single demote step) and assert that store.isPromotedByAny(graphA, '10', 'seed')
and store.isPromotedByAny(graphA, '11', 'steps') are false; this additional
assertion will fail if ref counts were incremented twice and not decremented by
one removal.
In `@src/stores/subgraphNavigationStore.test.ts`:
- Around line 149-180: The test currently defeats the workflow-switch behavior
by calling navigationStore.restoreState() manually after each activeWorkflow
change; update the test to rely on the store's automatic reaction to workflow
switches instead: initialize useSubgraphNavigationStore and useWorkflowStore,
set workflowStore.activeWorkflow = workflow1 and call
navigationStore.restoreState(['sub-1','sub-2']) once to seed state, then switch
workflowStore.activeWorkflow = workflow2 and assert
navigationStore.exportState() is reset (length 0) without calling restoreState
again, then switch back to workflow1 and assert navigationStore.exportState()
equals ['sub-1','sub-2']; reference restoreState, exportState,
useSubgraphNavigationStore, useWorkflowStore and activeWorkflow so the test
verifies the store's watcher/handler logic rather than re-applying state
manually.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 56144a35-a3b0-4235-9d03-c1d45ffd652b
📒 Files selected for processing (15)
browser_tests/fixtures/helpers/SubgraphHelper.tsbrowser_tests/helpers/promotedWidgets.tsbrowser_tests/tests/subgraph.spec.tsbrowser_tests/tests/subgraphLifecycle.spec.tsbrowser_tests/tests/subgraphProgressClear.spec.tsbrowser_tests/tests/subgraphPromotion.spec.tssrc/composables/graph/useSubgraphOperations.test.tssrc/core/graph/subgraph/promotedWidgetView.test.tssrc/core/graph/subgraph/resolveSubgraphInputLink.test.tssrc/core/graph/subgraph/resolveSubgraphInputTarget.test.tssrc/core/graph/subgraph/subgraphNodePromotion.test.tssrc/services/subgraphPseudoWidgetCache.test.tssrc/stores/promotionStore.test.tssrc/stores/subgraphNavigationStore.test.tssrc/stores/subgraphNavigationStore.viewport.test.ts
| 'Subgraph Lifecycle Edge Behaviors', | ||
| { tag: ['@subgraph'] }, | ||
| () => { | ||
| test.describe('Deterministic Hydrate from Serialized proxyWidgets', () => { |
There was a problem hiding this comment.
question: The old version of this test exercised a full page.reload() path with the subgraph-nested-duplicate-ids fixture to verify hydration survived a real browser boot cycle. The rewritten tests use in-memory serialize()/loadGraphData() round-trips with different fixtures instead.
Was the reload path dropped intentionally? The serialize round-trip is a good contract test, but it doesn't exercise the browser startup codepath (registered node types, DOM re-init, etc.) that the reload variant covered.
There was a problem hiding this comment.
Fair point — I restored boot-path confidence by adding a focused reload regression in �rowser_tests/tests/subgraph-duplicate-ids.spec.ts that snapshots promoted tuples, reloads, and verifies stability after reopen. So we now cover startup hydration again, not just in-memory round-trip.
| test.describe( | ||
| 'Subgraph Lifecycle Edge Behaviors', | ||
| { tag: ['@subgraph'] }, | ||
| () => { |
There was a problem hiding this comment.
question: The previous subgraphLifecycle suite had an "unpacking one preview host keeps remaining pseudo-preview promotions resolvable" test that unpacked node 7 and verified node 8's $$canvas-image-preview entries still resolved (using subgraph-with-multiple-promoted-previews). That cross-node isolation scenario appears to have been dropped rather than migrated.
Is there coverage for multi-node unpack isolation elsewhere, or was this intentionally descoped?
There was a problem hiding this comment.
Added explicit cross-node unpack isolation coverage in �rowser_tests/tests/subgraphLifecycle.spec.ts. Unpacking one host now verifies sibling pseudo-preview promotion state remains intact, which closes that gap proper.
| const sourceNode = subgraph?.getNodeById(sourceNodeId) | ||
| if (!sourceNode) invalid.push(`${node.id}:${entry[0]}`) | ||
| } | ||
| async function exitSubgraphViaBreadcrumb(comfyPage: ComfyPage): Promise<void> { |
There was a problem hiding this comment.
suggestion (non-blocking): exitSubgraphViaBreadcrumb is duplicated identically here and in subgraphPromotion.spec.ts:25. Consider extracting it into a shared helper (e.g. on SubgraphHelper or a helpers module) to keep a single source of truth.
There was a problem hiding this comment.
Agreed and implemented — duplicated breadcrumb/subgraph navigation utility logic was consolidated into SubgraphHelper so we have one source of truth on the fixture surface. Had a butcher's and removed the split utility file.
|
|
||
| // QuickLRU uses double-buffering: effective capacity is up to 2 * maxSize. | ||
| // Fill 65 entries (maxSize=32) so the earliest ones are fully evicted. | ||
| for (let i = 0; i < 65; i++) { |
There was a problem hiding this comment.
suggestion (non-blocking): The magic number 65 here relies on knowing QuickLRU's double-buffering implementation detail (2 * maxSize + 1). Consider deriving it from the actual maxSize constant (e.g. import { VIEWPORT_CACHE_SIZE } from ...) so the test stays correct if the capacity changes.
There was a problem hiding this comment.
Nice callout — the cache eviction test no longer hardcodes 65; it now derives overflow from exported VIEWPORT_CACHE_MAX_SIZE in src/stores/subgraphNavigationStore.ts / .viewport.test.ts. Keeps test intent aligned with implementation if capacity changes.
| await this.comfyPage.nextFrame() | ||
| } | ||
|
|
||
| async getNodeCount(): Promise<number> { |
There was a problem hiding this comment.
nitpick (non-blocking): This getNodeCount() reads from canvas.graph (the currently-viewed graph, which may be a subgraph), while NodeOperationsHelper.getNodeCount() reads from app.graph (always root). The semantic difference is meaningful but not documented -- a brief JSDoc note would help future readers understand when to reach for which.
There was a problem hiding this comment.
Added concise docs clarifying node-count scope differences between root-graph and current-canvas/subgraph helpers in NodeOperationsHelper and SubgraphHelper. All sorted after a final butcher's hook.
…and store sync Phase 4 of subgraph test coverage plan: Task 4.1 - Promotion pipeline contracts: - Multi-link representative determinism - Nested promotion chain propagation (3+ levels) - Retarget/disconnect cleanup behavior - Three-level nested value propagation - Multi-link callback exhaustion Task 4.2 - Store/service sync contracts: - Cache invalidation for stale nodes with changed widgets - Multiple pseudo-widget entries across nodes - Non-pseudo promotion exclusion - Promotion store ref-count consistency (clearGraph, idempotency, interleaving) - Workflow switch navigation reset/restore - Unreachable subgraph ID filtering - Multi-subgraph viewport round-trip - LRU viewport cache eviction - Non-SubgraphNode selection guard Amp-Thread-ID: https://ampcode.com/threads/T-019cf873-e8ef-778d-9f0d-65fc45b1df64 Co-authored-by: Amp <amp@ampcode.com>
…aviors Task 5.1: Add scenarios to existing specs - Multi-link representative stability through save/reload round-trip - Nested promotion retarget cleanup after slot removal - Breadcrumb disappears after workflow switch inside subgraph - Stale progress cleared on workflow switch inside subgraph Task 5.2: New lifecycle spec and helper expansion - Deterministic hydrate from serialized proxyWidgets (3 tests) - Placeholder behavior after promoted source removal (2 tests) - Unpack/remove cleanup for pseudo-preview targets (4 tests) - Add isPseudoPreviewEntry, getPseudoPreviewWidgets, getNonPreviewPromotedWidgets helpers - Add SubgraphHelper.getNodeCount() Amp-Thread-ID: https://ampcode.com/threads/T-019cf8d1-010f-7521-8e2c-3c94730b201b Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019cf91a-beff-772a-bf71-1dba8897183d Co-authored-by: Amp <amp@ampcode.com>
41be6af to
c259aa1
Compare
📦 Bundle: 5.01 MB gzip 🔴 +1.23 kBDetailsSummary
Category Glance App Entry Points — 22.7 kB (baseline 22.7 kB) • ⚪ 0 BMain entry bundles and manifests
Status: 1 added / 1 removed Graph Workspace — 1.11 MB (baseline 1.11 MB) • 🔴 +730 BGraph editor runtime, canvas, workflow orchestration
Status: 1 added / 1 removed Views & Navigation — 75.9 kB (baseline 75.9 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Status: 9 added / 9 removed / 2 unchanged Panels & Settings — 461 kB (baseline 461 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
Status: 10 added / 10 removed / 12 unchanged User & Accounts — 16.9 kB (baseline 16.9 kB) • ⚪ 0 BAuthentication, profile, and account management bundles
Status: 5 added / 5 removed / 2 unchanged Editors & Dialogs — 82 kB (baseline 82 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors
Status: 2 added / 2 removed UI Components — 59.4 kB (baseline 59.4 kB) • ⚪ 0 BReusable component library chunks
Status: 5 added / 5 removed / 8 unchanged Data & Services — 2.93 MB (baseline 2.93 MB) • 🔴 +5.42 kBStores, services, APIs, and repositories
Status: 14 added / 14 removed / 3 unchanged Utilities & Hooks — 322 kB (baseline 322 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Status: 14 added / 14 removed / 8 unchanged Vendor & Third-Party — 9.79 MB (baseline 9.79 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 16 unchanged Other — 8.24 MB (baseline 8.24 MB) • ⚪ 0 BBundles that do not match a named category
Status: 53 added / 53 removed / 79 unchanged ⚡ Performance
|
There was a problem hiding this comment.
♻️ Duplicate comments (3)
browser_tests/tests/subgraphProgressClear.spec.ts (1)
114-121:⚠️ Potential issue | 🟡 MinorWrap the post-switch progress assertion in
toPass()to reduce flakiness.This check is on an async cleanup path and can race; a retrying assertion (as already used earlier in this spec) is safer.
Proposed patch
- const progressAfter = await comfyPage.page.evaluate(() => { - const graph = window.app!.canvas.graph! - const subgraphNode = graph.nodes.find( - (n) => typeof n.isSubgraphNode === 'function' && n.isSubgraphNode() - ) - return subgraphNode?.progress - }) - expect(progressAfter).toBeUndefined() + await expect(async () => { + const progressAfter = await comfyPage.page.evaluate(() => { + const graph = window.app!.canvas.graph! + const subgraphNode = graph.nodes.find( + (n) => typeof n.isSubgraphNode === 'function' && n.isSubgraphNode() + ) + return subgraphNode?.progress + }) + expect(progressAfter).toBeUndefined() + }).toPass({ timeout: 5_000 })Based on learnings,
toPass()already retries with backoff in this repo and a ~5000ms timeout is the preferred stabilization approach for async operations. As per coding guidelines, browser Playwright specs should use retrying assertions rather than fixed waits.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@browser_tests/tests/subgraphProgressClear.spec.ts` around lines 114 - 121, The post-switch check for subgraph progress is flaky; change the direct assertion that reads progressAfter via comfyPage.page.evaluate and expects it toBeUndefined() into a retrying assertion using the repo's toPass() helper with ~5000ms timeout. Concretely, move the comfyPage.page.evaluate call inside a toPass() callback (or pass a function that calls comfyPage.page.evaluate) and assert that the evaluated subgraphNode?.progress is undefined inside toPass so it retries with backoff instead of a single expect(progressAfter).toBeUndefined().src/stores/subgraphNavigationStore.test.ts (1)
149-180:⚠️ Potential issue | 🟠 MajorWorkflow-switch test still bypasses the behavior it claims to validate.
This still manually reapplies navigation via
restoreState()after each switch, so it won’t catch regressions in switch-triggered reset/restore logic.💡 Suggested test adjustment
it('should reset navigation on workflow switch and restore on switch back', async () => { const navigationStore = useSubgraphNavigationStore() const workflowStore = useWorkflowStore() @@ workflowStore.activeWorkflow = workflow2 as typeof workflowStore.activeWorkflow - navigationStore.restoreState([]) + await nextTick() expect(navigationStore.exportState()).toHaveLength(0) @@ workflowStore.activeWorkflow = workflow1 as typeof workflowStore.activeWorkflow - navigationStore.restoreState(['sub-1', 'sub-2']) + await nextTick() expect(navigationStore.exportState()).toEqual(['sub-1', 'sub-2']) })As per coding guidelines, "Do not write tests that just test the mocks; ensure tests fail when code behaves unexpectedly."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/stores/subgraphNavigationStore.test.ts` around lines 149 - 180, The test currently re-applies navigation manually and therefore doesn't validate workflow-switch-driven reset/restore; update the test to call navigationStore.restoreState(...) only once to seed the store (e.g., before switching away), then change workflowStore.activeWorkflow to workflow2 and assert navigationStore.exportState() is empty (verifying automatic reset), then set activeWorkflow back to workflow1 and assert exportState() equals the seeded state (verifying automatic restore). Refer to useSubgraphNavigationStore, useWorkflowStore, activeWorkflow, restoreState, and exportState when locating and changing the test.browser_tests/tests/subgraphLifecycle.spec.ts (1)
198-243:⚠️ Potential issue | 🟠 MajorPseudo-preview cleanup tests still assert node deletion, not cleanup invariants.
Both tests can pass while pseudo-preview entries/preview artifacts leak elsewhere. Add post-action assertions that no remaining graph nodes retain
$$...proxy-widget entries (and keep a DOM-level no-preview assertion in the delete path).As per coding guidelines, "Do not write tests that just test the mocks; ensure tests fail when code behaves unexpectedly."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@browser_tests/tests/subgraphLifecycle.spec.ts` around lines 198 - 243, The tests currently only assert node removal but not that pseudo-preview artifacts are cleaned; after the unpack action in "Unpacking subgraph clears pseudo-preview entries from graph" and after the delete action in "Removing subgraph node clears pseudo-preview DOM elements", add assertions that iterate the remaining graph nodes (via window.app!.graph!.nodes or graph.getNodeById helpers) and verify none of their widget/property entries start with the proxy prefix "$$" (or contain proxy/preview objects returned by getPseudoPreviewWidgets), and retain the existing DOM-level assertion in the delete test to ensure no preview DOM elements remain; reference getPseudoPreviewWidgets, graph.unpackSubgraph, comfyPage.nodeOps.getNodeRefById and window.app!.graph! when locating where to insert these checks.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@browser_tests/tests/subgraphLifecycle.spec.ts`:
- Around line 198-243: The tests currently only assert node removal but not that
pseudo-preview artifacts are cleaned; after the unpack action in "Unpacking
subgraph clears pseudo-preview entries from graph" and after the delete action
in "Removing subgraph node clears pseudo-preview DOM elements", add assertions
that iterate the remaining graph nodes (via window.app!.graph!.nodes or
graph.getNodeById helpers) and verify none of their widget/property entries
start with the proxy prefix "$$" (or contain proxy/preview objects returned by
getPseudoPreviewWidgets), and retain the existing DOM-level assertion in the
delete test to ensure no preview DOM elements remain; reference
getPseudoPreviewWidgets, graph.unpackSubgraph, comfyPage.nodeOps.getNodeRefById
and window.app!.graph! when locating where to insert these checks.
In `@browser_tests/tests/subgraphProgressClear.spec.ts`:
- Around line 114-121: The post-switch check for subgraph progress is flaky;
change the direct assertion that reads progressAfter via comfyPage.page.evaluate
and expects it toBeUndefined() into a retrying assertion using the repo's
toPass() helper with ~5000ms timeout. Concretely, move the
comfyPage.page.evaluate call inside a toPass() callback (or pass a function that
calls comfyPage.page.evaluate) and assert that the evaluated
subgraphNode?.progress is undefined inside toPass so it retries with backoff
instead of a single expect(progressAfter).toBeUndefined().
In `@src/stores/subgraphNavigationStore.test.ts`:
- Around line 149-180: The test currently re-applies navigation manually and
therefore doesn't validate workflow-switch-driven reset/restore; update the test
to call navigationStore.restoreState(...) only once to seed the store (e.g.,
before switching away), then change workflowStore.activeWorkflow to workflow2
and assert navigationStore.exportState() is empty (verifying automatic reset),
then set activeWorkflow back to workflow1 and assert exportState() equals the
seeded state (verifying automatic restore). Refer to useSubgraphNavigationStore,
useWorkflowStore, activeWorkflow, restoreState, and exportState when locating
and changing the test.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 8a063efb-a830-4476-a3b0-a210fe323d5d
📒 Files selected for processing (15)
browser_tests/fixtures/helpers/SubgraphHelper.tsbrowser_tests/helpers/promotedWidgets.tsbrowser_tests/tests/subgraph.spec.tsbrowser_tests/tests/subgraphLifecycle.spec.tsbrowser_tests/tests/subgraphProgressClear.spec.tsbrowser_tests/tests/subgraphPromotion.spec.tssrc/composables/graph/useSubgraphOperations.test.tssrc/core/graph/subgraph/promotedWidgetView.test.tssrc/core/graph/subgraph/resolveSubgraphInputLink.test.tssrc/core/graph/subgraph/resolveSubgraphInputTarget.test.tssrc/core/graph/subgraph/subgraphNodePromotion.test.tssrc/services/subgraphPseudoWidgetCache.test.tssrc/stores/promotionStore.test.tssrc/stores/subgraphNavigationStore.test.tssrc/stores/subgraphNavigationStore.viewport.test.ts
🚧 Files skipped from review as they are similar to previous changes (9)
- src/stores/subgraphNavigationStore.viewport.test.ts
- src/core/graph/subgraph/subgraphNodePromotion.test.ts
- src/services/subgraphPseudoWidgetCache.test.ts
- browser_tests/tests/subgraphPromotion.spec.ts
- browser_tests/tests/subgraph.spec.ts
- browser_tests/fixtures/helpers/SubgraphHelper.ts
- src/core/graph/subgraph/resolveSubgraphInputTarget.test.ts
- src/core/graph/subgraph/resolveSubgraphInputLink.test.ts
- src/stores/promotionStore.test.ts
Amp-Thread-ID: https://ampcode.com/threads/T-019cfd7b-a5e5-71cd-b1e6-28c4c18814d4 Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
♻️ Duplicate comments (1)
browser_tests/tests/subgraphPromotion.spec.ts (1)
575-592:⚠️ Potential issue | 🟠 MajorCompare full promoted-widget tuples, not names-only, in the representative-stability test.
This assertion can still pass when the representative interior node changes but widget names remain the same. That misses the exact regression this test is meant to catch.
Suggested fix
const beforeSnapshot = await getPromotedWidgets(comfyPage, '11') expect(beforeSnapshot.length).toBeGreaterThan(0) - const beforeNames = beforeSnapshot.map(([, name]) => name) const serialized = await comfyPage.page.evaluate(() => { return window.app!.graph!.serialize() }) @@ const afterSnapshot = await getPromotedWidgets(comfyPage, '11') - const afterNames = afterSnapshot.map(([, name]) => name) - expect(afterNames).toEqual(beforeNames) - expect(afterSnapshot.length).toBe(beforeSnapshot.length) + expect(afterSnapshot).toEqual(beforeSnapshot)🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@browser_tests/tests/subgraphPromotion.spec.ts` around lines 575 - 592, The test currently only compares widget names (beforeNames vs afterNames) which can miss changes in the representative interior node; instead compare the full promoted-widget tuples returned by getPromotedWidgets so the entire tuple (e.g., id, name, representative info) must match. Locate the variables beforeSnapshot and afterSnapshot (and the call to getPromotedWidgets) in the representative-stability test and replace the names-only assertion with a deep equality assertion comparing afterSnapshot to beforeSnapshot (you can keep or remove the separate length check), ensuring the full tuples are used for the equality check.
🧹 Nitpick comments (1)
browser_tests/tests/subgraphPromotion.spec.ts (1)
762-776: Strengthen this test contract beyond count-only checks.You already capture
initialNames; asserting onlyfinalCountcan pass on unrelated changes. Consider asserting the post-removal promoted snapshot/names differ from the initial set in a specific, deterministic way.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@browser_tests/tests/subgraphPromotion.spec.ts` around lines 762 - 776, Replace the final count-only assertion with a deterministic comparison of promoted widget names: after calling exitSubgraphToParent(comfyPage), call getPromotedWidgetNames(comfyPage, '5') to get finalNames and assert that the final set differs from initialNames in a specific way (e.g., verify that a particular removed name from initialNames is not present in finalNames or that finalNames equals initialNames.filter(name => name !== expectedRemovedName)); keep using comfyPage.nodeOps.getNodeRefById('5') and the context menu steps but change expect(finalCount).toBeLessThan(initialCount) to an explicit set/membership or equality check between initialNames and finalNames so the test verifies the exact removal.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@browser_tests/tests/subgraphPromotion.spec.ts`:
- Around line 575-592: The test currently only compares widget names
(beforeNames vs afterNames) which can miss changes in the representative
interior node; instead compare the full promoted-widget tuples returned by
getPromotedWidgets so the entire tuple (e.g., id, name, representative info)
must match. Locate the variables beforeSnapshot and afterSnapshot (and the call
to getPromotedWidgets) in the representative-stability test and replace the
names-only assertion with a deep equality assertion comparing afterSnapshot to
beforeSnapshot (you can keep or remove the separate length check), ensuring the
full tuples are used for the equality check.
---
Nitpick comments:
In `@browser_tests/tests/subgraphPromotion.spec.ts`:
- Around line 762-776: Replace the final count-only assertion with a
deterministic comparison of promoted widget names: after calling
exitSubgraphToParent(comfyPage), call getPromotedWidgetNames(comfyPage, '5') to
get finalNames and assert that the final set differs from initialNames in a
specific way (e.g., verify that a particular removed name from initialNames is
not present in finalNames or that finalNames equals initialNames.filter(name =>
name !== expectedRemovedName)); keep using comfyPage.nodeOps.getNodeRefById('5')
and the context menu steps but change
expect(finalCount).toBeLessThan(initialCount) to an explicit set/membership or
equality check between initialNames and finalNames so the test verifies the
exact removal.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4c1db45c-ca10-4695-ad3e-5ca495d029f3
📒 Files selected for processing (1)
browser_tests/tests/subgraphPromotion.spec.ts
Amp-Thread-ID: https://ampcode.com/threads/T-019cfda0-3a43-7727-bdf9-7ea066d9f157 Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
♻️ Duplicate comments (1)
browser_tests/tests/subgraphLifecycle.spec.ts (1)
210-255:⚠️ Potential issue | 🟠 MajorCleanup tests are under-asserted for their stated behavior.
On Line 210 and Line 236, test names claim pseudo-preview cleanup, but assertions only check subgraph/node removal. These tests can pass even if
$$canvas-image-previewentries leak in remaining graph state.🔧 Suggested assertion hardening
test('Unpacking subgraph clears pseudo-preview entries from graph', async ({ comfyPage }) => { @@ const subgraphNodeCount = await comfyPage.page.evaluate(() => { const graph = window.app!.graph! return graph.nodes.filter((n) => n.isSubgraphNode()).length }) expect(subgraphNodeCount).toBe(0) + + const remainingPseudoEntries = await comfyPage.page.evaluate(() => { + const graph = window.app!.graph! + return graph.nodes.some((node) => + Array.isArray(node.properties?.proxyWidgets) && + node.properties.proxyWidgets.some( + ([, name]) => name === '$$canvas-image-preview' + ) + ) + }) + expect(remainingPseudoEntries).toBe(false) }) @@ test('Removing subgraph node clears pseudo-preview DOM elements', async ({ comfyPage }) => { @@ const nodeExists = await comfyPage.page.evaluate(() => { return !!window.app!.canvas.graph!.getNodeById('5') }) expect(nodeExists).toBe(false) + + const remainingPseudoEntries = await comfyPage.page.evaluate(() => { + const graph = window.app!.graph! + return graph.nodes.some((node) => + Array.isArray(node.properties?.proxyWidgets) && + node.properties.proxyWidgets.some( + ([, name]) => name === '$$canvas-image-preview' + ) + ) + }) + expect(remainingPseudoEntries).toBe(false) })🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@browser_tests/tests/subgraphLifecycle.spec.ts` around lines 210 - 255, The tests named "Unpacking subgraph clears pseudo-preview entries from graph" and "Removing subgraph node clears pseudo-preview DOM elements" currently only assert node removal; update each to also assert that no pseudo-preview artifacts remain by checking getPseudoPreviewWidgets(comfyPage, '5') returns length 0 after calling graph.unpackSubgraph(subgraphNode) (function: graph.unpackSubgraph / helper: getPseudoPreviewWidgets) and likewise after deleting the node via comfyPage.nodeOps.getNodeRefById('5') and keyboard Delete; alternatively verify DOM has no elements matching the pseudo-preview identifier ($$canvas-image-preview or a data-testid for it) and assert zero results.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@browser_tests/tests/subgraphLifecycle.spec.ts`:
- Around line 210-255: The tests named "Unpacking subgraph clears pseudo-preview
entries from graph" and "Removing subgraph node clears pseudo-preview DOM
elements" currently only assert node removal; update each to also assert that no
pseudo-preview artifacts remain by checking getPseudoPreviewWidgets(comfyPage,
'5') returns length 0 after calling graph.unpackSubgraph(subgraphNode)
(function: graph.unpackSubgraph / helper: getPseudoPreviewWidgets) and likewise
after deleting the node via comfyPage.nodeOps.getNodeRefById('5') and keyboard
Delete; alternatively verify DOM has no elements matching the pseudo-preview
identifier ($$canvas-image-preview or a data-testid for it) and assert zero
results.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: bfae77db-a9d6-4ca7-97f8-a29c1c84ae50
📒 Files selected for processing (4)
browser_tests/tests/subgraph.spec.tsbrowser_tests/tests/subgraphLifecycle.spec.tsbrowser_tests/tests/subgraphPromotion.spec.tssrc/scripts/app.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- browser_tests/tests/subgraph.spec.ts
- browser_tests/tests/subgraphPromotion.spec.ts
Amp-Thread-ID: https://ampcode.com/threads/T-019cfde3-9c0e-74af-8d07-a55ebe596290 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019cfe02-1ef8-702b-9f16-ae13fc3bb0f7 Co-authored-by: Amp <amp@ampcode.com>
|
Re: review body 3957460461 — addressed via the concrete inline fix set (lifecycle cleanup assertions, async retry hardening, tuple equality, idempotency strengthening, and workflow-switch behavior coverage). All landed and verified; Bob's your uncle. |
|
Re: review body 3963338418 — duplicate aggregate thread, fully covered by the inline fixes already merged into lifecycle/progress/promotion/navigation tests. No separate delta required. |
|
Re: review body 3963662873 — covered by implemented inline actions, including non-brittle assertions and derived constants where appropriate. Had a butcher's and kept it deterministic. |
|
Re: review body 3963885449 — addressed by lifecycle cleanup hardening and helper consolidation, so this duplicate body concern is fully covered by the shipped inline fix set. |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/stores/subgraphNavigationStore.test.ts (1)
54-56:⚠️ Potential issue | 🟠 MajorReset shared mocked app state in
beforeEachto prevent order-dependent tests.The module-level mock creates a shared
Mapforapp.rootGraph.subgraphsand sharedcanvas.subgraphthat are mutated throughout tests (lines 118–119, 169–170, 227, and multiple canvas.subgraph assignments). No cleanup exists between test cases, risking test order dependence and flakiness.🔧 Proposed fix
beforeEach(() => { setActivePinia(createTestingPinia({ stubActions: false })) + app.canvas.subgraph = undefined + app.rootGraph.subgraphs.clear() + vi.clearAllMocks() })Per Vitest guidelines: "keep module mocks contained without global mutable state; use
vi.hoisted()if necessary for per-test mock state manipulation."🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/stores/subgraphNavigationStore.test.ts` around lines 54 - 56, Module-level mocks create a shared mutable Map at app.rootGraph.subgraphs and a shared canvas.subgraph which are mutated across tests; modify the beforeEach to reset that shared mock state by reinitializing app.rootGraph.subgraphs to a new Map and setting canvas.subgraph back to its default (or recreate the mocked module) before each test—use vi.resetModules() or re-import the mocked module if needed to ensure per-test isolation; target the mock symbols app.rootGraph.subgraphs and canvas.subgraph (and any module that hoists those mocks) so each test gets a fresh Map and canvas state rather than relying on mutated shared instances.
🧹 Nitpick comments (1)
src/stores/subgraphNavigationStore.test.ts (1)
104-109: Replace repeatedPartial<Subgraph> as Subgraphdouble-casts with a typed fixture helper.These double-casts weaken type guarantees and duplicate setup. Prefer a helper using
satisfiesfor shape validation instead.♻️ Proposed refactor
+function createMockSubgraph(id: string, rootGraph: Subgraph['rootGraph']) { + const subgraph = { + id, + rootGraph, + _nodes: [], + nodes: [] + } satisfies Pick<Subgraph, 'id' | 'rootGraph' | '_nodes' | 'nodes'> + return subgraph as Subgraph +} ... -const sub1 = { - id: 'sub-1', - rootGraph: app.rootGraph, - _nodes: [], - nodes: [] -} as Partial<Subgraph> as Subgraph +const sub1 = createMockSubgraph('sub-1', app.rootGraph)Applies to lines 104–109, 111–116, 162–167, and 219–224.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/stores/subgraphNavigationStore.test.ts` around lines 104 - 109, Replace the repeated double-casts by adding a small typed fixture helper (e.g., createSubgraphFixture or makeSubgraph) that builds a default subgraph object and merges overrides, returning the result with a "satisfies Subgraph" validation; then replace each occurrence of "const sub1 = { ... } as Partial<Subgraph> as Subgraph" (and the similar sub2/sub3/sub4 fixtures) with calls to that helper (e.g., createSubgraphFixture({ id: 'sub-1', rootGraph: app.rootGraph, _nodes: [], nodes: [] })), ensuring the helper signature accepts Partial<Subgraph> and returns an object validated by satisfies Subgraph so you get compile-time shape checking without double-casting.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@browser_tests/tests/subgraphLifecycle.spec.ts`:
- Around line 136-162: The test "Promoted widget disappears from DOM after
interior node deletion" currently uses
comfyPage.page.getByTestId(TestIds.widgets.domWidgetTextarea) with
.not.toBeVisible(), which allows the element to remain hidden in-DOM; replace
that final assertion with a DOM-detachment check such as asserting the locator
has zero matches (e.g.,
expect(comfyPage.page.getByTestId(TestIds.widgets.domWidgetTextarea)).toHaveCount(0))
so the test verifies the element is removed from the DOM rather than merely
hidden.
---
Outside diff comments:
In `@src/stores/subgraphNavigationStore.test.ts`:
- Around line 54-56: Module-level mocks create a shared mutable Map at
app.rootGraph.subgraphs and a shared canvas.subgraph which are mutated across
tests; modify the beforeEach to reset that shared mock state by reinitializing
app.rootGraph.subgraphs to a new Map and setting canvas.subgraph back to its
default (or recreate the mocked module) before each test—use vi.resetModules()
or re-import the mocked module if needed to ensure per-test isolation; target
the mock symbols app.rootGraph.subgraphs and canvas.subgraph (and any module
that hoists those mocks) so each test gets a fresh Map and canvas state rather
than relying on mutated shared instances.
---
Nitpick comments:
In `@src/stores/subgraphNavigationStore.test.ts`:
- Around line 104-109: Replace the repeated double-casts by adding a small typed
fixture helper (e.g., createSubgraphFixture or makeSubgraph) that builds a
default subgraph object and merges overrides, returning the result with a
"satisfies Subgraph" validation; then replace each occurrence of "const sub1 = {
... } as Partial<Subgraph> as Subgraph" (and the similar sub2/sub3/sub4
fixtures) with calls to that helper (e.g., createSubgraphFixture({ id: 'sub-1',
rootGraph: app.rootGraph, _nodes: [], nodes: [] })), ensuring the helper
signature accepts Partial<Subgraph> and returns an object validated by satisfies
Subgraph so you get compile-time shape checking without double-casting.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 521a31ac-6d3a-4159-b984-a5a2d89616d4
📒 Files selected for processing (12)
browser_tests/fixtures/helpers/NodeOperationsHelper.tsbrowser_tests/fixtures/helpers/SubgraphHelper.tsbrowser_tests/tests/subgraph-duplicate-ids.spec.tsbrowser_tests/tests/subgraph.spec.tsbrowser_tests/tests/subgraphLifecycle.spec.tsbrowser_tests/tests/subgraphProgressClear.spec.tsbrowser_tests/tests/subgraphPromotion.spec.tssrc/scripts/app.tssrc/stores/promotionStore.test.tssrc/stores/subgraphNavigationStore.test.tssrc/stores/subgraphNavigationStore.tssrc/stores/subgraphNavigationStore.viewport.test.ts
✅ Files skipped from review due to trivial changes (1)
- browser_tests/fixtures/helpers/NodeOperationsHelper.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- src/stores/subgraphNavigationStore.viewport.test.ts
- browser_tests/tests/subgraph.spec.ts
…#10123) Add integration contract tests (unit) and expanded Playwright coverage for subgraph promotion, hydration, navigation, and lifecycle edge behaviors. - **What**: 22 unit/integration tests across 9 files covering promotion store sync, widget view lifecycle, input link resolution, pseudo-widget cache, navigation viewport restore, and subgraph operations. 13 Playwright E2E tests covering proxyWidgets hydration stability, promoted source removal cleanup, pseudo-preview unpack/remove, multi-link representative round-trip, nested promotion retarget, and navigation state on workflow switch. - **Helpers**: Added `isPseudoPreviewEntry`, `getPseudoPreviewWidgets`, `getNonPreviewPromotedWidgets` to promotedWidgets helper. Added `SubgraphHelper.getNodeCount()`. - Test-only PR — no production code changes - Validates existing subgraph behaviors are covered by regression tests before further feature work - Phase 4 (unit/integration contracts) and Phase 5 (Playwright expansion) of the subgraph test coverage plan ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10123-test-subgraph-integration-contracts-and-expanded-Playwright-coverage-3256d73d365081258023e3a763859e00) by [Unito](https://www.unito.io) --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: GitHub Action <action@github.com>
…#10123) Add integration contract tests (unit) and expanded Playwright coverage for subgraph promotion, hydration, navigation, and lifecycle edge behaviors. - **What**: 22 unit/integration tests across 9 files covering promotion store sync, widget view lifecycle, input link resolution, pseudo-widget cache, navigation viewport restore, and subgraph operations. 13 Playwright E2E tests covering proxyWidgets hydration stability, promoted source removal cleanup, pseudo-preview unpack/remove, multi-link representative round-trip, nested promotion retarget, and navigation state on workflow switch. - **Helpers**: Added `isPseudoPreviewEntry`, `getPseudoPreviewWidgets`, `getNonPreviewPromotedWidgets` to promotedWidgets helper. Added `SubgraphHelper.getNodeCount()`. - Test-only PR — no production code changes - Validates existing subgraph behaviors are covered by regression tests before further feature work - Phase 4 (unit/integration contracts) and Phase 5 (Playwright expansion) of the subgraph test coverage plan ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10123-test-subgraph-integration-contracts-and-expanded-Playwright-coverage-3256d73d365081258023e3a763859e00) by [Unito](https://www.unito.io) --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: GitHub Action <action@github.com>
…#10123) Add integration contract tests (unit) and expanded Playwright coverage for subgraph promotion, hydration, navigation, and lifecycle edge behaviors. - **What**: 22 unit/integration tests across 9 files covering promotion store sync, widget view lifecycle, input link resolution, pseudo-widget cache, navigation viewport restore, and subgraph operations. 13 Playwright E2E tests covering proxyWidgets hydration stability, promoted source removal cleanup, pseudo-preview unpack/remove, multi-link representative round-trip, nested promotion retarget, and navigation state on workflow switch. - **Helpers**: Added `isPseudoPreviewEntry`, `getPseudoPreviewWidgets`, `getNonPreviewPromotedWidgets` to promotedWidgets helper. Added `SubgraphHelper.getNodeCount()`. - Test-only PR — no production code changes - Validates existing subgraph behaviors are covered by regression tests before further feature work - Phase 4 (unit/integration contracts) and Phase 5 (Playwright expansion) of the subgraph test coverage plan ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10123-test-subgraph-integration-contracts-and-expanded-Playwright-coverage-3256d73d365081258023e3a763859e00) by [Unito](https://www.unito.io) --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: GitHub Action <action@github.com>
…d Playwright coverage (#10327) Backport of #10123, #9967, and #9972 to `core/1.42` Includes three cherry-picks in dependency order: 1. #9972 — `fix: resolve all lint warnings` (clean) 2. #9967 — `test: harden subgraph test coverage and remove low-value tests` (clean) 3. #10123 — `test: subgraph integration contracts and expanded Playwright coverage` (1 conflict, auto-resolved by rerere from #10326) See #10326 for core/1.41 backport with detailed conflict resolution notes. --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: bymyself <cbyrne@comfy.org> Co-authored-by: GitHub Action <action@github.com>
…ed Playwright coverage (#10329) Backport of #10123, #9967, and #9972 to `cloud/1.42` Includes three cherry-picks in dependency order: 1. #9972 — `fix: resolve all lint warnings` (clean) 2. #9967 — `test: harden subgraph test coverage and remove low-value tests` (clean) 3. #10123 — `test: subgraph integration contracts and expanded Playwright coverage` (1 conflict, auto-resolved by rerere from #10326) See #10326 for core/1.41 backport with detailed conflict resolution notes. --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: bymyself <cbyrne@comfy.org> Co-authored-by: GitHub Action <action@github.com>
…ed Playwright coverage (#10328) Backport of #10123, #9967, and #9972 to `cloud/1.41` Includes three cherry-picks in dependency order: 1. #9972 — `fix: resolve all lint warnings` (clean) 2. #9967 — `test: harden subgraph test coverage and remove low-value tests` (clean) 3. #10123 — `test: subgraph integration contracts and expanded Playwright coverage` (2 conflicts, auto-resolved by rerere from #10326) See #10326 for core/1.41 backport with detailed conflict resolution notes. --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: bymyself <cbyrne@comfy.org> Co-authored-by: GitHub Action <action@github.com>
The regression tests from Comfy-Org#10123 used bare cache keys (e.g. 'sub-1') but the PR's cacheKey() function prepends a workflow prefix (e.g. ':sub-1' when no workflow is active). Update the test to use the correct prefixed keys so restoreViewport lookups succeed.
The regression tests from Comfy-Org#10123 used bare cache keys (e.g. 'sub-1') but the PR's cacheKey() function prepends a workflow prefix (e.g. ':sub-1' when no workflow is active). Update the test to use the correct prefixed keys so restoreViewport lookups succeed.
The regression tests from Comfy-Org#10123 used bare cache keys (e.g. 'sub-1') but the PR's cacheKey() function prepends a workflow prefix (e.g. ':sub-1' when no workflow is active). Update the test to use the correct prefixed keys so restoreViewport lookups succeed.
The regression tests from Comfy-Org#10123 used bare cache keys (e.g. 'sub-1') but the PR's cacheKey() function prepends a workflow prefix (e.g. ':sub-1' when no workflow is active). Update the test to use the correct prefixed keys so restoreViewport lookups succeed.
The regression tests from Comfy-Org#10123 used bare cache keys (e.g. 'sub-1') but the PR's cacheKey() function prepends a workflow prefix (e.g. ':sub-1' when no workflow is active). Update the test to use the correct prefixed keys so restoreViewport lookups succeed.
The regression tests from Comfy-Org#10123 used bare cache keys (e.g. 'sub-1') but the PR's cacheKey() function prepends a workflow prefix (e.g. ':sub-1' when no workflow is active). Update the test to use the correct prefixed keys so restoreViewport lookups succeed.
The regression tests from Comfy-Org#10123 used bare cache keys (e.g. 'sub-1') but the PR's cacheKey() function prepends a workflow prefix (e.g. ':sub-1' when no workflow is active). Update the test to use the correct prefixed keys so restoreViewport lookups succeed.
|
|
|
|
…#10123) ## Summary Add integration contract tests (unit) and expanded Playwright coverage for subgraph promotion, hydration, navigation, and lifecycle edge behaviors. ## Changes - **What**: 22 unit/integration tests across 9 files covering promotion store sync, widget view lifecycle, input link resolution, pseudo-widget cache, navigation viewport restore, and subgraph operations. 13 Playwright E2E tests covering proxyWidgets hydration stability, promoted source removal cleanup, pseudo-preview unpack/remove, multi-link representative round-trip, nested promotion retarget, and navigation state on workflow switch. - **Helpers**: Added `isPseudoPreviewEntry`, `getPseudoPreviewWidgets`, `getNonPreviewPromotedWidgets` to promotedWidgets helper. Added `SubgraphHelper.getNodeCount()`. ## Review Focus - Test-only PR — no production code changes - Validates existing subgraph behaviors are covered by regression tests before further feature work - Phase 4 (unit/integration contracts) and Phase 5 (Playwright expansion) of the subgraph test coverage plan ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10123-test-subgraph-integration-contracts-and-expanded-Playwright-coverage-3256d73d365081258023e3a763859e00) by [Unito](https://www.unito.io) --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: GitHub Action <action@github.com>
|
|
|
|
…#10123) ## Summary Add integration contract tests (unit) and expanded Playwright coverage for subgraph promotion, hydration, navigation, and lifecycle edge behaviors. ## Changes - **What**: 22 unit/integration tests across 9 files covering promotion store sync, widget view lifecycle, input link resolution, pseudo-widget cache, navigation viewport restore, and subgraph operations. 13 Playwright E2E tests covering proxyWidgets hydration stability, promoted source removal cleanup, pseudo-preview unpack/remove, multi-link representative round-trip, nested promotion retarget, and navigation state on workflow switch. - **Helpers**: Added `isPseudoPreviewEntry`, `getPseudoPreviewWidgets`, `getNonPreviewPromotedWidgets` to promotedWidgets helper. Added `SubgraphHelper.getNodeCount()`. ## Review Focus - Test-only PR — no production code changes - Validates existing subgraph behaviors are covered by regression tests before further feature work - Phase 4 (unit/integration contracts) and Phase 5 (Playwright expansion) of the subgraph test coverage plan ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-10123-test-subgraph-integration-contracts-and-expanded-Playwright-coverage-3256d73d365081258023e3a763859e00) by [Unito](https://www.unito.io) --------- Co-authored-by: Amp <amp@ampcode.com> Co-authored-by: GitHub Action <action@github.com>
Summary
Add integration contract tests (unit) and expanded Playwright coverage for subgraph promotion, hydration, navigation, and lifecycle edge behaviors.
Changes
isPseudoPreviewEntry,getPseudoPreviewWidgets,getNonPreviewPromotedWidgetsto promotedWidgets helper. AddedSubgraphHelper.getNodeCount().Review Focus
┆Issue is synchronized with this Notion page by Unito