Skip to content

Commit 1a37d39

Browse files
committed
Fix send-message-helpers test: include questionIndex in test input
The AskUserAnswer type requires questionIndex. The test was passing an answer without questionIndex which caused a type error. Fixed by including questionIndex: 0 in both the test input and expected output, consistent with the working test in message-block-helpers.test.ts.
1 parent 63be0b9 commit 1a37d39

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

cli/src/utils/__tests__/send-message-helpers.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,12 +1428,11 @@ describe('transformAskUserBlocks', () => {
14281428

14291429
const result = transformAskUserBlocks(blocks, {
14301430
toolCallId: 'tool-1',
1431-
resultValue: { answers: [{ selectedOption: 'A' }] },
1431+
resultValue: { answers: [{ questionIndex: 0, selectedOption: 'A' }] },
14321432
})
14331433

14341434
expect(result[0].type).toBe('ask-user')
1435-
// Note: transformAskUserBlocks passes answers through as-is without adding questionIndex
1436-
expect((result[0] as AskUserContentBlock).answers).toEqual([{ selectedOption: 'A' }])
1435+
expect((result[0] as AskUserContentBlock).answers).toEqual([{ questionIndex: 0, selectedOption: 'A' }])
14371436
})
14381437

14391438
test('keeps tool block if no answers or skipped', () => {

0 commit comments

Comments
 (0)