Function
createBlock
(
id: string,
type: string,
position: { x: number; y: number },
overrides: Partial<BlockState> = {}
)
Source from the content-addressed store, hash-verified
| 16 | })) |
| 17 | |
| 18 | function createBlock( |
| 19 | id: string, |
| 20 | type: string, |
| 21 | position: { x: number; y: number }, |
| 22 | overrides: Partial<BlockState> = {} |
| 23 | ): BlockState { |
| 24 | return { |
| 25 | id, |
| 26 | type, |
| 27 | name: id, |
| 28 | position, |
| 29 | subBlocks: {}, |
| 30 | outputs: {}, |
| 31 | enabled: true, |
| 32 | layout: { measuredWidth: 250, measuredHeight: 120 }, |
| 33 | ...overrides, |
| 34 | } as BlockState |
| 35 | } |
| 36 | |
| 37 | beforeEach(() => { |
| 38 | mockGetBlock.mockReturnValue(null) |
Tested by
no test coverage detected