Skip to content

Commit bc2f74b

Browse files
committed
fix(greenhouse): type legacy import regression fixtures
1 parent 7c3d1ee commit bc2f74b

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

‎apps/sim/lib/workflows/migrations/subblock-migrations.test.ts‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,15 @@ describe('migrateSubblockIds', () => {
136136
])(
137137
'preserves bare Greenhouse input $value during import normalization',
138138
({ operation, value }) => {
139+
const legacySubBlocks: Record<string, unknown> = {
140+
operation,
141+
id: { id: 'id', type: 'short-input', value: 'unrelated-candidate' },
142+
update_application_id: value,
143+
convert_prospect_job_id: '<lookup.job.id>',
144+
}
139145
const block = makeBlock({
140146
type: 'greenhouse_v2',
141-
subBlocks: {
142-
operation,
143-
id: { id: 'id', type: 'short-input', value: 'unrelated-candidate' },
144-
update_application_id: value,
145-
convert_prospect_job_id: '<lookup.job.id>',
146-
} as BlockState['subBlocks'],
147+
subBlocks: legacySubBlocks as BlockState['subBlocks'],
147148
})
148149
const result = migrateSubblockIds({ 'block-1': block })
149150
const saved = result.blocks['block-1'].subBlocks
@@ -178,13 +179,14 @@ describe('migrateSubblockIds', () => {
178179
})
179180

180181
it('preserves a bare Greenhouse array over a stale list filter during import', () => {
182+
const legacySubBlocks: Record<string, unknown> = {
183+
operation: { id: 'operation', type: 'dropdown', value: 'create_application' },
184+
job_ids: { id: 'job_ids', type: 'short-input', value: '99' },
185+
create_application_job_ids: [42, 81],
186+
}
181187
const block = makeBlock({
182188
type: 'greenhouse_v2',
183-
subBlocks: {
184-
operation: { id: 'operation', type: 'dropdown', value: 'create_application' },
185-
job_ids: { id: 'job_ids', type: 'short-input', value: '99' },
186-
create_application_job_ids: [42, 81],
187-
} as BlockState['subBlocks'],
189+
subBlocks: legacySubBlocks as BlockState['subBlocks'],
188190
})
189191
const result = migrateSubblockIds({ 'block-1': block })
190192
expect(result.blocks['block-1'].subBlocks.job_ids.value).toEqual([42, 81])

0 commit comments

Comments
 (0)