MCPcopy Index your code
hub / github.com/simstudioai/sim / createBlockState

Function createBlockState

apps/sim/stores/undo-redo/utils.test.ts:118–135  ·  view source on GitHub ↗
(
    id: string,
    subBlocks: Record<string, { id: string; type: string; value: unknown }>
  )

Source from the content-addressed store, hash-verified

116 const workflowId = 'wf-test'
117
118 const createBlockState = (
119 id: string,
120 subBlocks: Record<string, { id: string; type: string; value: unknown }>
121 ): BlockState =>
122 ({
123 id,
124 type: 'function',
125 name: 'Test Block',
126 position: { x: 0, y: 0 },
127 subBlocks: Object.fromEntries(
128 Object.entries(subBlocks).map(([subId, sb]) => [
129 subId,
130 { id: sb.id, type: sb.type, value: sb.value },
131 ])
132 ),
133 outputs: {},
134 enabled: true,
135 }) as BlockState
136
137 beforeEach(() => {
138 vi.clearAllMocks()

Callers 1

utils.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected