[Test] Update expectations

This commit is contained in:
filtered
2025-05-15 14:24:15 +10:00
parent 7014d050e5
commit bf418d5d87

View File

@@ -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()
})
})
})