mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-04-30 04:30:48 +00:00
Sync upstream Gemini-CLI v0.8.2 (#838)
This commit is contained in:
parent
096fabb5d6
commit
eb95c131be
644 changed files with 70389 additions and 23709 deletions
62
packages/cli/src/ui/components/views/ToolsList.test.tsx
Normal file
62
packages/cli/src/ui/components/views/ToolsList.test.tsx
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { render } from 'ink-testing-library';
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { ToolsList } from './ToolsList.js';
|
||||
import { type ToolDefinition } from '../../types.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', () => {
|
||||
const { lastFrame } = render(
|
||||
<ToolsList
|
||||
tools={mockTools}
|
||||
showDescriptions={true}
|
||||
terminalWidth={40}
|
||||
/>,
|
||||
);
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('renders correctly without descriptions', () => {
|
||||
const { lastFrame } = render(
|
||||
<ToolsList
|
||||
tools={mockTools}
|
||||
showDescriptions={false}
|
||||
terminalWidth={40}
|
||||
/>,
|
||||
);
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('renders correctly with no tools', () => {
|
||||
const { lastFrame } = render(
|
||||
<ToolsList tools={[]} showDescriptions={true} terminalWidth={40} />,
|
||||
);
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue