mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 02:54:31 -07:00
test(cli): refactor tests for async render utilities (#23252)
This commit is contained in:
committed by
GitHub
parent
86a3a913b5
commit
6c78eb7a39
@@ -17,10 +17,9 @@ describe('IdeTrustChangeDialog', () => {
|
||||
});
|
||||
|
||||
it('renders the correct message for CONNECTION_CHANGE', async () => {
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
const { lastFrame, unmount } = await renderWithProviders(
|
||||
<IdeTrustChangeDialog reason="CONNECTION_CHANGE" />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
|
||||
const frameText = lastFrame();
|
||||
expect(frameText).toContain(
|
||||
@@ -31,10 +30,9 @@ describe('IdeTrustChangeDialog', () => {
|
||||
});
|
||||
|
||||
it('renders the correct message for TRUST_CHANGE', async () => {
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
const { lastFrame, unmount } = await renderWithProviders(
|
||||
<IdeTrustChangeDialog reason="TRUST_CHANGE" />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
|
||||
const frameText = lastFrame();
|
||||
expect(frameText).toContain(
|
||||
@@ -48,10 +46,9 @@ describe('IdeTrustChangeDialog', () => {
|
||||
const debugLoggerWarnSpy = vi
|
||||
.spyOn(debugLogger, 'warn')
|
||||
.mockImplementation(() => {});
|
||||
const { lastFrame, waitUntilReady, unmount } = await renderWithProviders(
|
||||
const { lastFrame, unmount } = await renderWithProviders(
|
||||
<IdeTrustChangeDialog reason="NONE" />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
|
||||
const frameText = lastFrame();
|
||||
expect(frameText).toContain('Workspace trust has changed.');
|
||||
@@ -68,7 +65,6 @@ describe('IdeTrustChangeDialog', () => {
|
||||
const { stdin, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<IdeTrustChangeDialog reason="NONE" />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
|
||||
await act(async () => {
|
||||
stdin.write('r');
|
||||
@@ -86,7 +82,6 @@ describe('IdeTrustChangeDialog', () => {
|
||||
const { stdin, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<IdeTrustChangeDialog reason="CONNECTION_CHANGE" />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
|
||||
await act(async () => {
|
||||
stdin.write('R');
|
||||
@@ -104,7 +99,6 @@ describe('IdeTrustChangeDialog', () => {
|
||||
const { stdin, waitUntilReady, unmount } = await renderWithProviders(
|
||||
<IdeTrustChangeDialog reason="CONNECTION_CHANGE" />,
|
||||
);
|
||||
await waitUntilReady();
|
||||
|
||||
await act(async () => {
|
||||
stdin.write('a');
|
||||
|
||||
Reference in New Issue
Block a user