mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-20 02:00:40 -07:00
refactor(cli): integrate real config loading into async test utils (#23040)
This commit is contained in:
committed by
GitHub
parent
7de0616229
commit
23264ced9a
@@ -350,7 +350,7 @@ describe('MainContent', () => {
|
||||
});
|
||||
|
||||
it('renders in normal buffer mode', async () => {
|
||||
const { lastFrame, unmount } = renderWithProviders(<MainContent />, {
|
||||
const { lastFrame, unmount } = await renderWithProviders(<MainContent />, {
|
||||
uiState: defaultMockUiState as Partial<UIState>,
|
||||
});
|
||||
await waitFor(() => expect(lastFrame()).toContain('AppHeader(full)'));
|
||||
@@ -364,7 +364,7 @@ describe('MainContent', () => {
|
||||
|
||||
it('renders in alternate buffer mode', async () => {
|
||||
vi.mocked(useAlternateBuffer).mockReturnValue(true);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MainContent />,
|
||||
{
|
||||
uiState: defaultMockUiState as Partial<UIState>,
|
||||
@@ -382,7 +382,7 @@ describe('MainContent', () => {
|
||||
it('renders minimal header in minimal mode (alternate buffer)', async () => {
|
||||
vi.mocked(useAlternateBuffer).mockReturnValue(true);
|
||||
|
||||
const { lastFrame, unmount } = renderWithProviders(<MainContent />, {
|
||||
const { lastFrame, unmount } = await renderWithProviders(<MainContent />, {
|
||||
uiState: {
|
||||
...defaultMockUiState,
|
||||
cleanUiDetailsVisible: false,
|
||||
@@ -417,7 +417,7 @@ describe('MainContent', () => {
|
||||
);
|
||||
};
|
||||
|
||||
const { lastFrame } = renderWithProviders(<ToggleHarness />, {
|
||||
const { lastFrame } = await renderWithProviders(<ToggleHarness />, {
|
||||
uiState: {
|
||||
...defaultMockUiState,
|
||||
cleanUiDetailsVisible: false,
|
||||
@@ -439,7 +439,7 @@ describe('MainContent', () => {
|
||||
|
||||
it('always renders full header details in normal buffer mode', async () => {
|
||||
vi.mocked(useAlternateBuffer).mockReturnValue(false);
|
||||
const { lastFrame } = renderWithProviders(<MainContent />, {
|
||||
const { lastFrame } = await renderWithProviders(<MainContent />, {
|
||||
uiState: {
|
||||
...defaultMockUiState,
|
||||
cleanUiDetailsVisible: false,
|
||||
@@ -452,7 +452,7 @@ describe('MainContent', () => {
|
||||
|
||||
it('does not constrain height in alternate buffer mode', async () => {
|
||||
vi.mocked(useAlternateBuffer).mockReturnValue(true);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MainContent />,
|
||||
{
|
||||
uiState: defaultMockUiState as Partial<UIState>,
|
||||
@@ -479,7 +479,7 @@ describe('MainContent', () => {
|
||||
staticAreaMaxItemHeight: 5,
|
||||
};
|
||||
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MainContent />,
|
||||
{
|
||||
uiState: uiState as Partial<UIState>,
|
||||
@@ -507,7 +507,7 @@ describe('MainContent', () => {
|
||||
staticAreaMaxItemHeight: 5,
|
||||
};
|
||||
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MainContent />,
|
||||
{
|
||||
uiState: uiState as unknown as Partial<UIState>,
|
||||
@@ -564,7 +564,7 @@ describe('MainContent', () => {
|
||||
],
|
||||
};
|
||||
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<MainContent />,
|
||||
{
|
||||
uiState: uiState as Partial<UIState>,
|
||||
@@ -626,7 +626,7 @@ describe('MainContent', () => {
|
||||
],
|
||||
};
|
||||
|
||||
const renderResult = renderWithProviders(<MainContent />, {
|
||||
const renderResult = await renderWithProviders(<MainContent />, {
|
||||
uiState: uiState as Partial<UIState>,
|
||||
});
|
||||
await renderResult.waitUntilReady();
|
||||
@@ -732,16 +732,14 @@ describe('MainContent', () => {
|
||||
bannerVisible: false,
|
||||
};
|
||||
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
<MainContent />,
|
||||
{
|
||||
const { lastFrame, waitUntilReady, unmount } =
|
||||
await renderWithProviders(<MainContent />, {
|
||||
uiState: uiState as Partial<UIState>,
|
||||
config: makeFakeConfig({ useAlternateBuffer: isAlternateBuffer }),
|
||||
settings: createMockSettings({
|
||||
ui: { useAlternateBuffer: isAlternateBuffer },
|
||||
}),
|
||||
},
|
||||
);
|
||||
});
|
||||
await waitUntilReady();
|
||||
|
||||
const output = lastFrame();
|
||||
|
||||
Reference in New Issue
Block a user