mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-23 01:37:16 -07:00
test(cli): fix any type usage and typecast in test files
This commit is contained in:
@@ -529,7 +529,7 @@ describe('MainContent', () => {
|
||||
],
|
||||
state: 'running',
|
||||
},
|
||||
} as unknown as IndividualToolCallDisplay;
|
||||
} as Partial<IndividualToolCallDisplay> as IndividualToolCallDisplay;
|
||||
|
||||
const uiState = {
|
||||
...defaultMockUiState,
|
||||
@@ -620,7 +620,7 @@ describe('MainContent', () => {
|
||||
approvalMode: ApprovalMode.PLAN,
|
||||
status: CoreToolCallStatus.Success,
|
||||
resultDisplay: 'Hidden content',
|
||||
} as unknown as IndividualToolCallDisplay,
|
||||
} as Partial<IndividualToolCallDisplay> as IndividualToolCallDisplay,
|
||||
];
|
||||
|
||||
const confirmingTool = {
|
||||
@@ -696,7 +696,7 @@ describe('MainContent', () => {
|
||||
approvalMode: ApprovalMode.PLAN,
|
||||
status: CoreToolCallStatus.Success,
|
||||
resultDisplay: 'hidden',
|
||||
} as unknown as IndividualToolCallDisplay,
|
||||
} as Partial<IndividualToolCallDisplay> as IndividualToolCallDisplay,
|
||||
],
|
||||
borderBottom: true,
|
||||
},
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
} from '@google/gemini-cli-core';
|
||||
import os from 'node:os';
|
||||
import { createMockSettings } from '../../../test-utils/settings.js';
|
||||
import type { IndividualToolCallDisplay } from '../../types.js';
|
||||
|
||||
describe('ToolGroupMessage Regression Tests', () => {
|
||||
const baseMockConfig = makeFakeConfig({
|
||||
@@ -26,16 +27,17 @@ describe('ToolGroupMessage Regression Tests', () => {
|
||||
ui: { errorVerbosity: 'full' },
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const createToolCall = (overrides: any = {}) => ({
|
||||
callId: 'tool-123',
|
||||
name: 'test-tool',
|
||||
status: CoreToolCallStatus.Success,
|
||||
...overrides,
|
||||
});
|
||||
const createToolCall = (
|
||||
overrides: Partial<IndividualToolCallDisplay> = {},
|
||||
): IndividualToolCallDisplay =>
|
||||
({
|
||||
callId: 'tool-123',
|
||||
name: 'test-tool',
|
||||
status: CoreToolCallStatus.Success,
|
||||
...overrides,
|
||||
}) as IndividualToolCallDisplay;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const createItem = (tools: any[]) => ({
|
||||
const createItem = (tools: IndividualToolCallDisplay[]) => ({
|
||||
id: 1,
|
||||
type: 'tool_group' as const,
|
||||
tools,
|
||||
@@ -72,11 +74,11 @@ describe('ToolGroupMessage Regression Tests', () => {
|
||||
kind: Kind.Agent,
|
||||
status: CoreToolCallStatus.Executing,
|
||||
resultDisplay: {
|
||||
isSubagentProgress: true,
|
||||
agentName: 'TestAgent',
|
||||
state: 'running',
|
||||
recentActivity: [],
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any,
|
||||
},
|
||||
}),
|
||||
];
|
||||
const item = createItem(toolCalls);
|
||||
@@ -108,11 +110,11 @@ describe('ToolGroupMessage Regression Tests', () => {
|
||||
kind: Kind.Agent,
|
||||
status: CoreToolCallStatus.Success,
|
||||
resultDisplay: {
|
||||
isSubagentProgress: true,
|
||||
agentName: 'TestAgent',
|
||||
state: 'completed',
|
||||
recentActivity: [],
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
} as any,
|
||||
},
|
||||
}),
|
||||
];
|
||||
const item = createItem(toolCalls);
|
||||
@@ -138,8 +140,7 @@ describe('ToolGroupMessage Regression Tests', () => {
|
||||
});
|
||||
|
||||
it('Bridges: still renders a bridge if it has a top border', async () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
const toolCalls: any[] = [];
|
||||
const toolCalls: IndividualToolCallDisplay[] = [];
|
||||
const item = createItem(toolCalls);
|
||||
|
||||
const { lastFrame, unmount } = await renderWithProviders(
|
||||
|
||||
Reference in New Issue
Block a user