mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-21 02:24:09 -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
@@ -31,7 +31,7 @@ describe('ToolResultDisplay', () => {
|
||||
},
|
||||
],
|
||||
];
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<ToolResultDisplay
|
||||
resultDisplay={ansiResult}
|
||||
terminalWidth={80}
|
||||
@@ -50,7 +50,7 @@ describe('ToolResultDisplay', () => {
|
||||
});
|
||||
|
||||
it('uses Scrollable for non-ANSI output in alternate buffer mode', async () => {
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<ToolResultDisplay
|
||||
resultDisplay="**Markdown content**"
|
||||
terminalWidth={80}
|
||||
@@ -70,7 +70,7 @@ describe('ToolResultDisplay', () => {
|
||||
});
|
||||
|
||||
it('passes hasFocus prop to scrollable components', async () => {
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<ToolResultDisplay
|
||||
resultDisplay="Some result"
|
||||
terminalWidth={80}
|
||||
@@ -88,7 +88,7 @@ describe('ToolResultDisplay', () => {
|
||||
});
|
||||
|
||||
it('renders string result as markdown by default', async () => {
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<ToolResultDisplay resultDisplay="**Some result**" terminalWidth={80} />,
|
||||
{
|
||||
config: makeFakeConfig({ useAlternateBuffer: false }),
|
||||
@@ -103,7 +103,7 @@ describe('ToolResultDisplay', () => {
|
||||
});
|
||||
|
||||
it('renders string result as plain text when renderOutputAsMarkdown is false', async () => {
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<ToolResultDisplay
|
||||
resultDisplay="**Some result**"
|
||||
terminalWidth={80}
|
||||
@@ -125,7 +125,7 @@ describe('ToolResultDisplay', () => {
|
||||
|
||||
it('truncates very long string results', { timeout: 20000 }, async () => {
|
||||
const longString = 'a'.repeat(1000005);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<ToolResultDisplay
|
||||
resultDisplay={longString}
|
||||
terminalWidth={80}
|
||||
@@ -149,7 +149,7 @@ describe('ToolResultDisplay', () => {
|
||||
fileDiff: 'diff content',
|
||||
fileName: 'test.ts',
|
||||
};
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<ToolResultDisplay
|
||||
resultDisplay={diffResult}
|
||||
terminalWidth={80}
|
||||
@@ -182,7 +182,7 @@ describe('ToolResultDisplay', () => {
|
||||
},
|
||||
],
|
||||
];
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<ToolResultDisplay
|
||||
resultDisplay={ansiResult as unknown as AnsiOutput}
|
||||
terminalWidth={80}
|
||||
@@ -204,7 +204,7 @@ describe('ToolResultDisplay', () => {
|
||||
const todoResult = {
|
||||
todos: [],
|
||||
};
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<ToolResultDisplay
|
||||
resultDisplay={todoResult}
|
||||
terminalWidth={80}
|
||||
@@ -224,7 +224,7 @@ describe('ToolResultDisplay', () => {
|
||||
|
||||
it('does not fall back to plain text if availableHeight is set and not in alternate buffer', async () => {
|
||||
// availableHeight calculation: 20 - 1 - 5 = 14 > 3
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<ToolResultDisplay
|
||||
resultDisplay="**Some result**"
|
||||
terminalWidth={80}
|
||||
@@ -244,7 +244,7 @@ describe('ToolResultDisplay', () => {
|
||||
});
|
||||
|
||||
it('keeps markdown if in alternate buffer even with availableHeight', async () => {
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<ToolResultDisplay
|
||||
resultDisplay="**Some result**"
|
||||
terminalWidth={80}
|
||||
@@ -326,7 +326,7 @@ describe('ToolResultDisplay', () => {
|
||||
},
|
||||
],
|
||||
];
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<ToolResultDisplay
|
||||
resultDisplay={ansiResult}
|
||||
terminalWidth={80}
|
||||
@@ -363,7 +363,7 @@ describe('ToolResultDisplay', () => {
|
||||
inverse: false,
|
||||
},
|
||||
]);
|
||||
const { lastFrame, waitUntilReady, unmount } = renderWithProviders(
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<ToolResultDisplay
|
||||
resultDisplay={ansiResult}
|
||||
terminalWidth={80}
|
||||
|
||||
Reference in New Issue
Block a user