mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-27 05:24:34 -07:00
feat(cli): prototype clean UI toggle and minimal-mode bleed-through (#18683)
This commit is contained in:
@@ -14,7 +14,7 @@ import {
|
||||
type Mock,
|
||||
type MockedObject,
|
||||
} from 'vitest';
|
||||
import { render } from '../test-utils/render.js';
|
||||
import { render, persistentStateMock } from '../test-utils/render.js';
|
||||
import { waitFor } from '../test-utils/async.js';
|
||||
import { cleanup } from 'ink-testing-library';
|
||||
import { act, useContext, type ReactElement } from 'react';
|
||||
@@ -299,6 +299,7 @@ describe('AppContainer State Management', () => {
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
persistentStateMock.reset();
|
||||
vi.clearAllMocks();
|
||||
|
||||
mockIdeClient.getInstance.mockReturnValue(new Promise(() => {}));
|
||||
@@ -488,6 +489,37 @@ describe('AppContainer State Management', () => {
|
||||
await waitFor(() => expect(capturedUIState).toBeTruthy());
|
||||
unmount!();
|
||||
});
|
||||
|
||||
it('shows full UI details by default', async () => {
|
||||
let unmount: () => void;
|
||||
await act(async () => {
|
||||
const result = renderAppContainer();
|
||||
unmount = result.unmount;
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(capturedUIState.cleanUiDetailsVisible).toBe(true);
|
||||
});
|
||||
unmount!();
|
||||
});
|
||||
|
||||
it('starts in minimal UI mode when Focus UI preference is persisted', async () => {
|
||||
persistentStateMock.get.mockReturnValueOnce(true);
|
||||
|
||||
let unmount: () => void;
|
||||
await act(async () => {
|
||||
const result = renderAppContainer({
|
||||
settings: mockSettings,
|
||||
});
|
||||
unmount = result.unmount;
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(capturedUIState.cleanUiDetailsVisible).toBe(false);
|
||||
});
|
||||
expect(persistentStateMock.get).toHaveBeenCalledWith('focusUiEnabled');
|
||||
unmount!();
|
||||
});
|
||||
});
|
||||
|
||||
describe('State Initialization', () => {
|
||||
|
||||
Reference in New Issue
Block a user