mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-02 01:11:24 -07:00
test: support tests that include color information (#20220)
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
import { act } from 'react';
|
||||
import type { EventEmitter } from 'node:events';
|
||||
import { render } from '../../test-utils/render.js';
|
||||
import { renderWithProviders } from '../../test-utils/render.js';
|
||||
import { waitFor } from '../../test-utils/async.js';
|
||||
import { ConfigInitDisplay } from './ConfigInitDisplay.js';
|
||||
import {
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
import { Text } from 'ink';
|
||||
|
||||
// Mock GeminiSpinner
|
||||
vi.mock('./GeminiRespondingSpinner.js', () => ({
|
||||
vi.mock('./GeminiSpinner.js', () => ({
|
||||
GeminiSpinner: () => <Text>Spinner</Text>,
|
||||
}));
|
||||
|
||||
@@ -43,7 +43,9 @@ describe('ConfigInitDisplay', () => {
|
||||
});
|
||||
|
||||
it('renders initial state', async () => {
|
||||
const { lastFrame, waitUntilReady } = render(<ConfigInitDisplay />);
|
||||
const { lastFrame, waitUntilReady } = renderWithProviders(
|
||||
<ConfigInitDisplay />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
});
|
||||
@@ -57,7 +59,7 @@ describe('ConfigInitDisplay', () => {
|
||||
return coreEvents;
|
||||
});
|
||||
|
||||
const { lastFrame } = render(<ConfigInitDisplay />);
|
||||
const { lastFrame } = renderWithProviders(<ConfigInitDisplay />);
|
||||
|
||||
// Wait for listener to be registered
|
||||
await waitFor(() => {
|
||||
@@ -95,7 +97,7 @@ describe('ConfigInitDisplay', () => {
|
||||
return coreEvents;
|
||||
});
|
||||
|
||||
const { lastFrame } = render(<ConfigInitDisplay />);
|
||||
const { lastFrame } = renderWithProviders(<ConfigInitDisplay />);
|
||||
|
||||
await waitFor(() => {
|
||||
if (!listener) throw new Error('Listener not registered yet');
|
||||
@@ -131,7 +133,7 @@ describe('ConfigInitDisplay', () => {
|
||||
return coreEvents;
|
||||
});
|
||||
|
||||
const { lastFrame } = render(<ConfigInitDisplay />);
|
||||
const { lastFrame } = renderWithProviders(<ConfigInitDisplay />);
|
||||
|
||||
await waitFor(() => {
|
||||
if (!listener) throw new Error('Listener not registered yet');
|
||||
|
||||
Reference in New Issue
Block a user