From 3e9aec9f94a12e58906ef65e2d6839d3e6676d8a Mon Sep 17 00:00:00 2001 From: Brooklyn Nicholson Date: Sun, 12 Jul 2026 05:36:23 -0400 Subject: [PATCH] test(desktop): satisfy ToolCallMessagePartProps in clarify tests CI typecheck requires argsText, status, addResult, and resume on rendered tool parts. --- .../assistant-ui/clarify-tool.test.tsx | 48 ++++++++++++------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/apps/desktop/src/components/assistant-ui/clarify-tool.test.tsx b/apps/desktop/src/components/assistant-ui/clarify-tool.test.tsx index 20a859610dd7..a508b8471c51 100644 --- a/apps/desktop/src/components/assistant-ui/clarify-tool.test.tsx +++ b/apps/desktop/src/components/assistant-ui/clarify-tool.test.tsx @@ -1,6 +1,7 @@ import { cleanup, render, screen } from '@testing-library/react' +import type { ToolCallMessagePartProps } from '@assistant-ui/react' import type { ReactNode } from 'react' -import { afterEach, describe, expect, it } from 'vitest' +import { afterEach, describe, expect, it, vi } from 'vitest' import { I18nProvider } from '@/i18n' @@ -18,6 +19,25 @@ function renderClarify(ui: ReactNode) { ) } +function settledClarifyProps( + args: ToolCallMessagePartProps['args'], + result: ToolCallMessagePartProps['result'], + toolCallId: string +): ToolCallMessagePartProps { + return { + addResult: vi.fn(), + args, + argsText: JSON.stringify(args), + isError: false, + result, + resume: vi.fn(), + status: { type: 'complete' }, + toolCallId, + toolName: 'clarify', + type: 'tool-call' + } +} + describe('readClarifyResult', () => { it('reads question + user_response from the tool JSON payload', () => { expect( @@ -61,16 +81,15 @@ describe('ClarifyTool settled view', () => { it('keeps the question and answer visible after the tool completes', () => { renderClarify( ) @@ -83,12 +102,7 @@ describe('ClarifyTool settled view', () => { it('labels an empty response as Skipped', () => { renderClarify( )