diff options
| author | Marcin Jahn <[email protected]> | 2025-06-30 01:56:37 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-29 23:56:37 +0000 |
| commit | d1eb86581ce800778e5a093039ce237ec6da6118 (patch) | |
| tree | 4ae636719beea4b0cfaa2a65e270d2f5968a61ff /packages/cli/src/ui/App.test.tsx | |
| parent | 1732e90d52f26c03981eaefd28183b73dddfeccd (diff) | |
feat(cli): Add hideTips setting (#1524)
Co-authored-by: Allen Hutchison <[email protected]>
Diffstat (limited to 'packages/cli/src/ui/App.test.tsx')
| -rw-r--r-- | packages/cli/src/ui/App.test.tsx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/packages/cli/src/ui/App.test.tsx b/packages/cli/src/ui/App.test.tsx index 2f12615b..ecd56f5e 100644 --- a/packages/cli/src/ui/App.test.tsx +++ b/packages/cli/src/ui/App.test.tsx @@ -17,6 +17,7 @@ import { } from '@google/gemini-cli-core'; import { LoadedSettings, SettingsFile, Settings } from '../config/settings.js'; import process from 'node:process'; +import { Tips } from './components/Tips.js'; // Define a more complete mock server config based on actual Config interface MockServerConfig { @@ -173,6 +174,10 @@ vi.mock('../config/config.js', async (importOriginal) => { }; }); +vi.mock('./components/Tips.js', () => ({ + Tips: vi.fn(() => null), +})); + describe('App UI', () => { let mockConfig: MockServerConfig; let mockSettings: LoadedSettings; @@ -379,6 +384,34 @@ describe('App UI', () => { expect(lastFrame()).toContain('Using 2 MCP servers'); }); + it('should display Tips component by default', async () => { + const { unmount } = render( + <App + config={mockConfig as unknown as ServerConfig} + settings={mockSettings} + />, + ); + currentUnmount = unmount; + await Promise.resolve(); + expect(vi.mocked(Tips)).toHaveBeenCalled(); + }); + + it('should not display Tips component when hideTips is true', async () => { + mockSettings = createMockSettings({ + hideTips: true, + }); + + const { unmount } = render( + <App + config={mockConfig as unknown as ServerConfig} + settings={mockSettings} + />, + ); + currentUnmount = unmount; + await Promise.resolve(); + expect(vi.mocked(Tips)).not.toHaveBeenCalled(); + }); + describe('when no theme is set', () => { let originalNoColor: string | undefined; |
