From c931793cf139eea02ace6f473bf625d3ec72db86 Mon Sep 17 00:00:00 2001 From: Siddharth Ganesan Date: Wed, 28 Jan 2026 11:47:26 -0800 Subject: [PATCH] Add tests --- apps/sim/executor/utils/run-from-block.test.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/sim/executor/utils/run-from-block.test.ts b/apps/sim/executor/utils/run-from-block.test.ts index 732d89a36..07c83ed81 100644 --- a/apps/sim/executor/utils/run-from-block.test.ts +++ b/apps/sim/executor/utils/run-from-block.test.ts @@ -321,9 +321,14 @@ describe('validateRunFromBlock', () => { }) it('rejects blocks with unexecuted upstream dependencies', () => { - // A → B, only A executed but B depends on A - const dag = createDAG([createNode('A', [{ target: 'B' }]), createNode('B')]) - const executedBlocks = new Set() // A was not executed + // X → A → B, where A was not executed but B depends on A + // X is the entry point (no incoming edges), A is a regular block + const dag = createDAG([ + createNode('X', [{ target: 'A' }]), + createNode('A', [{ target: 'B' }]), + createNode('B'), + ]) + const executedBlocks = new Set(['X']) // X executed but A was not const result = validateRunFromBlock('B', dag, executedBlocks)