Skip to content

Commit 24de74f

Browse files
committed
fix(blocks): type the sweep2 m4 mapper tests and stripe JSON spreads for test-types
1 parent ec0a631 commit 24de74f

6 files changed

Lines changed: 14 additions & 13 deletions

File tree

‎apps/sim/blocks/blocks/jotform.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('JotformBlock', () => {
3131
* on the tool row must still reach the tool's `title` param.
3232
*/
3333
it('maps tool-row fields on an agent tool call', () => {
34-
const args = { apiKey: 'key', formId: '2315', reportTitle: 'Weekly' }
34+
const args: Record<string, unknown> = { apiKey: 'key', formId: '2315', reportTitle: 'Weekly' }
3535

3636
expect({ ...args, ...buildParams(args, { operation: 'create_report' }) }.title).toBe('Weekly')
3737
})

‎apps/sim/blocks/blocks/kalshi.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('KalshiBlock', () => {
1010
* on the tool row must still reach the tool's `orderId` param.
1111
*/
1212
it('maps the order ID field on an agent tool call', () => {
13-
const args = { keyId: 'key', privateKey: 'pem', orderIdParam: 'ord-1' }
13+
const args: Record<string, unknown> = { keyId: 'key', privateKey: 'pem', orderIdParam: 'ord-1' }
1414

1515
expect({ ...args, ...buildParams(args, { operation: 'cancel_order' }) }.orderId).toBe('ord-1')
1616
})

‎apps/sim/blocks/blocks/mintlify.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { describe, expect, it } from 'vitest'
22
import { MintlifyBlock } from '@/blocks/blocks/mintlify'
33

4-
const blockParams = MintlifyBlock.tools.config?.params
5-
if (!blockParams) throw new Error('MintlifyBlock has no params mapper')
4+
const mapper = MintlifyBlock.tools.config?.params
5+
if (!mapper) throw new Error('MintlifyBlock has no params mapper')
6+
const blockParams = mapper
67

78
/**
89
* The executor merges `tools.config.params` on top of the raw inputs, so every

‎apps/sim/blocks/blocks/parallel.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ if (!blockParams) throw new Error('ParallelBlock has no params mapper')
66

77
describe('ParallelBlock', () => {
88
it('maps an agent search call, whose operation arrives only in context', () => {
9-
const args = { objective: 'When was the UN founded?', include_domains: 'un.org' }
9+
const args: Record<string, unknown> = {
10+
objective: 'When was the UN founded?',
11+
include_domains: 'un.org',
12+
}
1013
const result = {
1114
...args,
1215
...blockParams(args, { operation: 'search' }),

‎apps/sim/blocks/blocks/stripe.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,11 +1006,11 @@ export const StripeBlock: BlockConfig = {
10061006
return {
10071007
apiKey,
10081008
...rest,
1009-
...(parsedAddress && { address: parsedAddress }),
1010-
...(parsedMetadata && { metadata: parsedMetadata }),
1011-
...(parsedItems && { items: parsedItems }),
1012-
...(parsedImages && { images: parsedImages }),
1013-
...(parsedRecurring && { recurring: parsedRecurring }),
1009+
...(parsedAddress ? { address: parsedAddress } : {}),
1010+
...(parsedMetadata ? { metadata: parsedMetadata } : {}),
1011+
...(parsedItems ? { items: parsedItems } : {}),
1012+
...(parsedImages ? { images: parsedImages } : {}),
1013+
...(parsedRecurring ? { recurring: parsedRecurring } : {}),
10141014
...parsedBooleans,
10151015
...pagination,
10161016
}

‎scripts/check-test-types.baseline.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -652,9 +652,6 @@
652652
"apps/sim/blocks/blocks/mem0.test.ts": {
653653
"TS18048": 1
654654
},
655-
"apps/sim/blocks/blocks/mintlify.test.ts": {
656-
"TS18048": 1
657-
},
658655
"apps/sim/blocks/blocks/mssql.test.ts": {
659656
"TS18048": 1,
660657
"TS2339": 2

0 commit comments

Comments
 (0)