mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-02 01:11:24 -07:00
refactor(cli): better react patterns for BaseSettingsDialog (#21206)
This commit is contained in:
@@ -327,5 +327,31 @@ describe('AgentConfigDialog', () => {
|
||||
expect(frame).toContain('false');
|
||||
unmount();
|
||||
});
|
||||
it('should respond to availableTerminalHeight and truncate list', async () => {
|
||||
const settings = createMockSettings();
|
||||
// Agent config has about 6 base items + 2 per tool
|
||||
// Render with very small height (20)
|
||||
const { lastFrame, unmount } = render(
|
||||
<KeypressProvider>
|
||||
<AgentConfigDialog
|
||||
agentName="test-agent"
|
||||
displayName="Test Agent"
|
||||
definition={createMockAgentDefinition()}
|
||||
settings={settings}
|
||||
onClose={mockOnClose}
|
||||
onSave={mockOnSave}
|
||||
availableTerminalHeight={20}
|
||||
/>
|
||||
</KeypressProvider>,
|
||||
);
|
||||
await waitFor(() =>
|
||||
expect(lastFrame()).toContain('Configure: Test Agent'),
|
||||
);
|
||||
|
||||
const frame = lastFrame();
|
||||
// At height 20, it should be heavily truncated and show '▼'
|
||||
expect(frame).toContain('▼');
|
||||
unmount();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user