mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 19:44:30 -07:00
test(cli): refactor tests for async render utilities (#23252)
This commit is contained in:
committed by
GitHub
parent
86a3a913b5
commit
6c78eb7a39
@@ -24,13 +24,12 @@ describe('<GeminiMessage /> - Raw Markdown Display Snapshots', () => {
|
||||
])(
|
||||
'renders with renderMarkdown=$renderMarkdown $description',
|
||||
async ({ renderMarkdown }) => {
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
const { lastFrame, unmount } = await renderWithProviders(
|
||||
<GeminiMessage {...baseProps} />,
|
||||
{
|
||||
uiState: { renderMarkdown, streamingState: StreamingState.Idle },
|
||||
},
|
||||
);
|
||||
await waitUntilReady();
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
unmount();
|
||||
},
|
||||
@@ -39,13 +38,12 @@ describe('<GeminiMessage /> - Raw Markdown Display Snapshots', () => {
|
||||
it.each([{ renderMarkdown: true }, { renderMarkdown: false }])(
|
||||
'renders pending state with renderMarkdown=$renderMarkdown',
|
||||
async ({ renderMarkdown }) => {
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
const { lastFrame, unmount } = await renderWithProviders(
|
||||
<GeminiMessage {...baseProps} isPending={true} />,
|
||||
{
|
||||
uiState: { renderMarkdown, streamingState: StreamingState.Idle },
|
||||
},
|
||||
);
|
||||
await waitUntilReady();
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
unmount();
|
||||
},
|
||||
@@ -55,7 +53,7 @@ describe('<GeminiMessage /> - Raw Markdown Display Snapshots', () => {
|
||||
const terminalWidth = 20;
|
||||
const text =
|
||||
'This is a long line that should wrap correctly without truncation';
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
const { lastFrame, unmount } = await renderWithProviders(
|
||||
<GeminiMessage
|
||||
text={text}
|
||||
isPending={false}
|
||||
@@ -65,7 +63,6 @@ describe('<GeminiMessage /> - Raw Markdown Display Snapshots', () => {
|
||||
uiState: { renderMarkdown: false, streamingState: StreamingState.Idle },
|
||||
},
|
||||
);
|
||||
await waitUntilReady();
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
unmount();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user