Download packages/cli/src/ui/components/views/ToolsList.test.tsx from SaylorTwift/gemini-cli: direct link, hf CLI and curl.
- Browser
- Download file 1.74 kB
-
https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/components/views/ToolsList.test.tsx
- Command line
-
hf download hf://SaylorTwift/gemini-cli/packages/cli/src/ui/components/views/ToolsList.test.tsx
-
curl -L -o ToolsList.test.tsx https://huggingface.co/SaylorTwift/gemini-cli/resolve/main/packages/cli/src/ui/components/views/ToolsList.test.tsx
1.74 kB
| /** | |
| * @license | |
| * Copyright 2025 Google LLC | |
| * SPDX-License-Identifier: Apache-2.0 | |
| */ | |
| import { describe, it, expect } from 'vitest'; | |
| import { ToolsList } from './ToolsList.js'; | |
| import { type ToolDefinition } from '../../types.js'; | |
| import { renderWithProviders } from '../../../test-utils/render.js'; | |
| const mockTools: ToolDefinition[] = [ | |
| { | |
| name: 'test-tool-one', | |
| displayName: 'Test Tool One', | |
| description: 'This is the first test tool.', | |
| }, | |
| { | |
| name: 'test-tool-two', | |
| displayName: 'Test Tool Two', | |
| description: `This is the second test tool. | |
| 1. Tool descriptions support markdown formatting. | |
| 2. **note** use this tool wisely and be sure to consider how this tool interacts with word wrap. | |
| 3. **important** this tool is awesome.`, | |
| }, | |
| { | |
| name: 'test-tool-three', | |
| displayName: 'Test Tool Three', | |
| description: 'This is the third test tool.', | |
| }, | |
| ]; | |
| describe('<ToolsList />', () => { | |
| it('renders correctly with descriptions', async () => { | |
| const { lastFrame } = await renderWithProviders( | |
| <ToolsList | |
| tools={mockTools} | |
| showDescriptions={true} | |
| terminalWidth={40} | |
| />, | |
| ); | |
| expect(lastFrame()).toMatchSnapshot(); | |
| }); | |
| it('renders correctly without descriptions', async () => { | |
| const { lastFrame } = await renderWithProviders( | |
| <ToolsList | |
| tools={mockTools} | |
| showDescriptions={false} | |
| terminalWidth={40} | |
| />, | |
| ); | |
| expect(lastFrame()).toMatchSnapshot(); | |
| }); | |
| it('renders correctly with no tools', async () => { | |
| const { lastFrame } = await renderWithProviders( | |
| <ToolsList tools={[]} showDescriptions={true} terminalWidth={40} />, | |
| ); | |
| expect(lastFrame()).toMatchSnapshot(); | |
| }); | |
| }); | |