mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-11 22:00:41 -07:00
restore snapshot and fix tests
This commit is contained in:
@@ -12,6 +12,17 @@ import { Text } from 'ink';
|
||||
import { renderWithProviders } from '../../test-utils/render.js';
|
||||
import type { Config } from '@google/gemini-cli-core';
|
||||
|
||||
vi.mock('../../utils/persistentState.js', () => ({
|
||||
persistentState: {
|
||||
get: vi.fn().mockImplementation((key) => {
|
||||
if (key === 'tipsShown') return false;
|
||||
if (key === 'defaultBannerShownCount') return {};
|
||||
return undefined;
|
||||
}),
|
||||
set: vi.fn(),
|
||||
},
|
||||
}));
|
||||
|
||||
vi.mock('../utils/terminalSetup.js', () => ({
|
||||
getTerminalProgram: () => null,
|
||||
}));
|
||||
|
||||
@@ -133,7 +133,17 @@ describe('<AppHeader />', () => {
|
||||
});
|
||||
|
||||
it('should not render the default banner if shown count is 5 or more', () => {
|
||||
persistentStateMock.get.mockReturnValue(5);
|
||||
persistentStateMock.get.mockImplementation((key) => {
|
||||
if (key === 'defaultBannerShownCount') {
|
||||
const hash = crypto
|
||||
.createHash('sha256')
|
||||
.update('This is the default banner')
|
||||
.digest('hex');
|
||||
return { [hash]: 5 };
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
|
||||
const mockConfig = makeFakeConfig();
|
||||
const uiState = {
|
||||
history: [],
|
||||
|
||||
@@ -46,7 +46,12 @@ exports[`<AppHeader /> > should not render the default banner if shown count is
|
||||
███░ ░░███ ░░███
|
||||
███░ ░░█████████
|
||||
░░░ ░░░░░░░░░
|
||||
"
|
||||
|
||||
Tips for getting started:
|
||||
1. Ask questions, edit files, or run commands.
|
||||
2. Be specific for the best results.
|
||||
3. Create GEMINI.md files to customize your interactions with Gemini.
|
||||
4. /help for more information."
|
||||
`;
|
||||
|
||||
exports[`<AppHeader /> > should render the banner when previewFeatures is disabled 1`] = `
|
||||
|
||||
Reference in New Issue
Block a user