test(cli): fix cross-platform footer test alignment and path normalization

This commit is contained in:
Jack Wotherspoon
2026-02-26 09:01:34 -05:00
committed by Keith Guerin
parent 0292a20d41
commit 32e01f723a
2 changed files with 25 additions and 14 deletions
@@ -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('<Footer />', () => {
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(
<Footer />,