2026-04-16 05:48:28 +00:00
|
|
|
/**
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright 2026 Google LLC
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { describe, it, beforeEach, afterEach } from 'vitest';
|
|
|
|
|
import { TestRig } from '@google/gemini-cli-test-utils';
|
|
|
|
|
|
|
|
|
|
describe('Gemini CLI TTY Bootstrap', () => {
|
|
|
|
|
let rig: TestRig;
|
|
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
|
rig = new TestRig();
|
|
|
|
|
rig.setup('TTY Bootstrap Smoke Test');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
afterEach(async () => {
|
|
|
|
|
await rig.cleanup();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('should render the interactive UI and display the ready marker in a TTY', async () => {
|
|
|
|
|
// Spawning the CLI in a pseudo-TTY with a dummy API key to bypass auth prompt
|
|
|
|
|
const run = await rig.runInteractive({
|
|
|
|
|
env: { GEMINI_API_KEY: 'dummy-key' },
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// The ready marker we expect to see
|
|
|
|
|
const readyMarker = 'Type your message or @path/to/file';
|
2026-04-21 14:20:53 +00:00
|
|
|
const tipsMessage = 'tips for getting started:';
|
2026-04-16 05:48:28 +00:00
|
|
|
|
|
|
|
|
// Verify the initial render completes and displays the markers
|
2026-04-21 14:20:53 +00:00
|
|
|
await run.expectText(tipsMessage, 30000);
|
2026-04-16 05:48:28 +00:00
|
|
|
await run.expectText(readyMarker, 30000);
|
|
|
|
|
|
|
|
|
|
// If we reached here, the smoke test passed
|
|
|
|
|
await run.kill();
|
|
|
|
|
});
|
|
|
|
|
});
|