From bf418d5d8710c46dda843538bbfc6d9046d86ff0 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Thu, 15 May 2025 14:24:15 +1000 Subject: [PATCH] [Test] Update expectations --- tests-ui/tests/store/workflowStore.test.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tests-ui/tests/store/workflowStore.test.ts b/tests-ui/tests/store/workflowStore.test.ts index 096491eb1..4c5668c8f 100644 --- a/tests-ui/tests/store/workflowStore.test.ts +++ b/tests-ui/tests/store/workflowStore.test.ts @@ -492,7 +492,7 @@ describe('useWorkflowStore', () => { // Assert console.debug(store.isSubgraphActive) expect(store.isSubgraphActive).toBe(false) // Should default to false - expect(store.subgraphNamePath).toEqual([]) // Should default to empty + expect(store.activeSubgraph).toBeUndefined() // Should default to empty }) it('should correctly update state when the root graph is active', async () => { @@ -505,7 +505,7 @@ describe('useWorkflowStore', () => { // Assert: Check store state expect(store.isSubgraphActive).toBe(false) - expect(store.subgraphNamePath).toEqual([]) // Path is empty for root graph + expect(store.activeSubgraph).toBeUndefined() }) it('should correctly update state when a subgraph is active', async () => { @@ -527,10 +527,7 @@ describe('useWorkflowStore', () => { // Assert: Check store state expect(store.isSubgraphActive).toBe(true) - expect(store.subgraphNamePath).toEqual([ - 'Level 1 Subgraph', - 'Level 2 Subgraph' - ]) // Path excludes the root + expect(store.activeSubgraph).toEqual(mockSubgraph) }) it('should update automatically when activeWorkflow changes', async () => { @@ -548,7 +545,7 @@ describe('useWorkflowStore', () => { // Verify initial state expect(store.isSubgraphActive).toBe(true) - expect(store.subgraphNamePath).toEqual(['Initial Subgraph']) + expect(store.activeSubgraph).toEqual(initialSubgraph) // Act: Change the active workflow const workflow2 = store.createTemporary('workflow2.json') @@ -569,7 +566,7 @@ describe('useWorkflowStore', () => { // Assert: Check that the state was updated by the watcher based on the *new* canvas state expect(store.isSubgraphActive).toBe(false) // Should reflect the change to undefined subgraph - expect(store.subgraphNamePath).toEqual([]) // Path should be empty for root + expect(store.activeSubgraph).toBeUndefined() }) }) })