Function
expectBlockExists
(
blocks: Record<string, any>,
blockId: string,
expectedType?: string
)
Source from the content-addressed store, hash-verified
| 13 | * ``` |
| 14 | */ |
| 15 | export function expectBlockExists( |
| 16 | blocks: Record<string, any>, |
| 17 | blockId: string, |
| 18 | expectedType?: string |
| 19 | ): void { |
| 20 | expect(blocks[blockId], `Block "${blockId}" should exist`).toBeDefined() |
| 21 | expect(blocks[blockId].id).toBe(blockId) |
| 22 | if (expectedType) { |
| 23 | expect(blocks[blockId].type, `Block "${blockId}" should be type "${expectedType}"`).toBe( |
| 24 | expectedType |
| 25 | ) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Asserts that a block does NOT exist in the workflow. |
Tested by
no test coverage detected