diff --git a/packages/cli/src/ui/components/Footer.test.tsx b/packages/cli/src/ui/components/Footer.test.tsx
index ff131ae755..d8892d0b28 100644
--- a/packages/cli/src/ui/components/Footer.test.tsx
+++ b/packages/cli/src/ui/components/Footer.test.tsx
@@ -11,10 +11,9 @@ import { createMockSettings } from '../../test-utils/settings.js';
import path from 'node:path';
// Normalize paths to POSIX slashes for stable cross-platform snapshots.
-// We replace the Windows drive letter with spaces to preserve the rendered string length.
const normalizeFrame = (frame: string | undefined) => {
if (!frame) return frame;
- return frame.replace(/\\/g, '/').replace(/[A-Za-z]:\//g, ' /');
+ return frame.replace(/\\/g, '/');
};
const mockSessionStats = {
@@ -73,6 +72,11 @@ const defaultProps = {
};
describe('', () => {
+ beforeEach(() => {
+ const root = path.parse(process.cwd()).root;
+ vi.stubEnv('GEMINI_CLI_HOME', path.join(root, 'Users', 'test'));
+ });
+
it('renders the component', async () => {
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
,
diff --git a/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap b/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap
index 61908c80f7..b0b76218b1 100644
--- a/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap
+++ b/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap
@@ -1,38 +1,45 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[` > displays "Limit reached" message when remaining is 0 1`] = `
-" Path /docs /model /stats
- /Users/test/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox gemini-pro limit reached"
+" Path /docs /model /stats
+ ~/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox gemini-pro limit reached
+"
`;
exports[` > displays the usage indicator when usage is low 1`] = `
-" Path /docs /model /stats
- /Users/test/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox gemini-pro daily 15%"
+" Path /docs /model /stats
+ ~/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox gemini-pro daily 15%
+"
`;
exports[` > footer configuration filtering (golden snapshots) > renders complete footer in narrow terminal (baseline narrow) > complete-footer-narrow 1`] = `
" Path /docs /model Context
- /Users/.../directories/to/make/it/long no sandbox gemini-pro 100%"
+ ~/.../more/directories/to/make/it/long no sandbox gemini-pro 86%
+"
`;
exports[` > footer configuration filtering (golden snapshots) > renders complete footer with all sections visible (baseline) > complete-footer-wide 1`] = `
-" Path /docs /model Context
- /Users/test/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox gemini-pro 100% left"
+" Path /docs /model Context
+ ~/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox gemini-pro 86% left
+"
`;
exports[` > footer configuration filtering (golden snapshots) > renders footer with CWD and model info hidden to test alignment (only sandbox visible) > footer-only-sandbox 1`] = `
" /docs
- no sandbox"
+ no sandbox
+"
`;
exports[` > footer configuration filtering (golden snapshots) > renders footer with all optional sections hidden (minimal footer) > footer-minimal 1`] = `""`;
exports[` > footer configuration filtering (golden snapshots) > renders footer with only model info hidden (partial filtering) > footer-no-model 1`] = `
-" Path /docs
- /Users/test/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox"
+" Path /docs
+ ~/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox
+"
`;
exports[` > hides the usage indicator when usage is not near limit 1`] = `
-" Path /docs /model /stats
- /Users/test/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox gemini-pro daily 85%"
+" Path /docs /model /stats
+ ~/project/foo/bar/and/some/more/directories/to/make/it/long no sandbox gemini-pro daily 85%
+"
`;