mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-17 00:31:44 -07:00
test(cli): refactor tests for async render utilities (#23252)
This commit is contained in:
committed by
GitHub
parent
86a3a913b5
commit
6c78eb7a39
@@ -154,7 +154,7 @@ describe('SessionBrowser component', () => {
|
||||
const onDeleteSession = vi.fn().mockResolvedValue(undefined);
|
||||
const onExit = vi.fn();
|
||||
|
||||
const { lastFrame, waitUntilReady } = render(
|
||||
const { lastFrame } = await render(
|
||||
<TestSessionBrowser
|
||||
config={config}
|
||||
onResumeSession={onResumeSession}
|
||||
@@ -163,7 +163,6 @@ describe('SessionBrowser component', () => {
|
||||
testSessions={[]}
|
||||
/>,
|
||||
);
|
||||
await waitUntilReady();
|
||||
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
});
|
||||
@@ -192,7 +191,7 @@ describe('SessionBrowser component', () => {
|
||||
const onDeleteSession = vi.fn().mockResolvedValue(undefined);
|
||||
const onExit = vi.fn();
|
||||
|
||||
const { lastFrame, waitUntilReady } = render(
|
||||
const { lastFrame } = await render(
|
||||
<TestSessionBrowser
|
||||
config={config}
|
||||
onResumeSession={onResumeSession}
|
||||
@@ -201,7 +200,6 @@ describe('SessionBrowser component', () => {
|
||||
testSessions={[session1, session2]}
|
||||
/>,
|
||||
);
|
||||
await waitUntilReady();
|
||||
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
});
|
||||
@@ -245,7 +243,7 @@ describe('SessionBrowser component', () => {
|
||||
const onDeleteSession = vi.fn().mockResolvedValue(undefined);
|
||||
const onExit = vi.fn();
|
||||
|
||||
const { lastFrame, waitUntilReady } = render(
|
||||
const { lastFrame, waitUntilReady } = await render(
|
||||
<TestSessionBrowser
|
||||
config={config}
|
||||
onResumeSession={onResumeSession}
|
||||
@@ -254,7 +252,6 @@ describe('SessionBrowser component', () => {
|
||||
testSessions={[searchSession, otherSession]}
|
||||
/>,
|
||||
);
|
||||
await waitUntilReady();
|
||||
|
||||
expect(lastFrame()).toContain('Chat Sessions (2 total');
|
||||
|
||||
@@ -305,7 +302,7 @@ describe('SessionBrowser component', () => {
|
||||
const onDeleteSession = vi.fn().mockResolvedValue(undefined);
|
||||
const onExit = vi.fn();
|
||||
|
||||
const { lastFrame, waitUntilReady } = render(
|
||||
const { lastFrame, waitUntilReady } = await render(
|
||||
<TestSessionBrowser
|
||||
config={config}
|
||||
onResumeSession={onResumeSession}
|
||||
@@ -314,7 +311,6 @@ describe('SessionBrowser component', () => {
|
||||
testSessions={[session1, session2]}
|
||||
/>,
|
||||
);
|
||||
await waitUntilReady();
|
||||
|
||||
expect(lastFrame()).toContain('Chat Sessions (2 total');
|
||||
|
||||
@@ -354,7 +350,7 @@ describe('SessionBrowser component', () => {
|
||||
const onDeleteSession = vi.fn().mockResolvedValue(undefined);
|
||||
const onExit = vi.fn();
|
||||
|
||||
const { waitUntilReady } = render(
|
||||
const { waitUntilReady } = await render(
|
||||
<TestSessionBrowser
|
||||
config={config}
|
||||
onResumeSession={onResumeSession}
|
||||
@@ -363,7 +359,6 @@ describe('SessionBrowser component', () => {
|
||||
testSessions={[currentSession, otherSession]}
|
||||
/>,
|
||||
);
|
||||
await waitUntilReady();
|
||||
|
||||
// Active selection is at 0 (current session).
|
||||
triggerKey({ name: 'enter', sequence: '\r' });
|
||||
@@ -382,7 +377,7 @@ describe('SessionBrowser component', () => {
|
||||
const onDeleteSession = vi.fn().mockResolvedValue(undefined);
|
||||
const onExit = vi.fn();
|
||||
|
||||
const { lastFrame, waitUntilReady } = render(
|
||||
const { lastFrame } = await render(
|
||||
<TestSessionBrowser
|
||||
config={config}
|
||||
onResumeSession={onResumeSession}
|
||||
@@ -391,7 +386,6 @@ describe('SessionBrowser component', () => {
|
||||
testError="storage failure"
|
||||
/>,
|
||||
);
|
||||
await waitUntilReady();
|
||||
|
||||
expect(lastFrame()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user