diff --git a/src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx b/src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx index c4f2024cfe4..84f58acf2e9 100644 --- a/src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx +++ b/src/renderer/src/components/native-chat/NativeChatStructuredSession.test.tsx @@ -7,6 +7,10 @@ import type { AgentJournalRenderItem } from '../../../../shared/agent-session-jo import type { AgentSessionBackgroundTask } from '../../../../shared/agent-session-wire' import { decodeAgentSessionQuestionAnswers } from '../../../../shared/agent-session-question-answer' import type { NativeChatQuestionCardProps } from './NativeChatQuestionCard' +import { + claudeGroupedQuestionPromptItems, + legacySingleQuestionPromptItems +} from './native-chat-structured-question-test-fixtures' const mocks = vi.hoisted(() => ({ call: vi.fn(), @@ -800,46 +804,7 @@ describe('NativeChatStructuredSession', () => { }, 30000) it('passes Claude grouped questions and one shared answer through the card', () => { - mocks.promptItems = [ - { - itemId: 'question-item', - revision: 1, - sequence: 1, - observedAt: 1, - body: { - kind: 'question', - question: '2 grouped questions from Claude', - options: [], - questions: [ - { - id: 'q1', - header: 'Targets', - question: 'Which targets?', - multiSelect: true, - options: [ - { id: 'target-web', label: 'Web' }, - { id: 'target-mobile', label: 'Mobile' } - ], - freeTextQuestionId: 'q1' - }, - { - id: 'q2', - header: 'Host', - question: 'Where should it run?', - multiSelect: false, - options: [], - freeTextQuestionId: 'q2' - } - ], - resolution: { - state: 'pending', - selectedOptionId: null, - resolvedBy: null, - resolvedAt: null - } - } - } - ] + mocks.promptItems = claudeGroupedQuestionPromptItems render( { }) it('keeps legacy single-question option ids and free text behavior', () => { - mocks.promptItems = [ - { - itemId: 'legacy-question-item', - revision: 1, - sequence: 1, - observedAt: 1, - body: { - kind: 'question', - question: 'Pick a library', - options: [ - { id: 'q1:choice-1', label: 'React' }, - { id: 'q1:choice-2', label: 'Vue' } - ], - freeTextQuestionId: 'q1', - resolution: { - state: 'pending', - selectedOptionId: null, - resolvedBy: null, - resolvedAt: null - } - } - } - ] + mocks.promptItems = legacySingleQuestionPromptItems render(