mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-26 04:54:25 -07:00
test(cli): refactor tests for async render utilities (#23252)
This commit is contained in:
committed by
GitHub
parent
86a3a913b5
commit
6c78eb7a39
@@ -39,7 +39,9 @@ describe('useShellInactivityStatus', () => {
|
||||
};
|
||||
|
||||
it('should show action_required status after 30s when output has been produced', async () => {
|
||||
const { result } = renderHook(() => useShellInactivityStatus(defaultProps));
|
||||
const { result } = await renderHook(() =>
|
||||
useShellInactivityStatus(defaultProps),
|
||||
);
|
||||
|
||||
expect(result.current.inactivityStatus).toBe('none');
|
||||
|
||||
@@ -50,7 +52,7 @@ describe('useShellInactivityStatus', () => {
|
||||
});
|
||||
|
||||
it('should show silent_working status after 60s when no output has been produced (silent)', async () => {
|
||||
const { result } = renderHook(() =>
|
||||
const { result } = await renderHook(() =>
|
||||
useShellInactivityStatus({ ...defaultProps, lastOutputTime: 500 }),
|
||||
);
|
||||
|
||||
@@ -71,7 +73,9 @@ describe('useShellInactivityStatus', () => {
|
||||
isRedirectionActive: true,
|
||||
});
|
||||
|
||||
const { result } = renderHook(() => useShellInactivityStatus(defaultProps));
|
||||
const { result } = await renderHook(() =>
|
||||
useShellInactivityStatus(defaultProps),
|
||||
);
|
||||
|
||||
// Should NOT show action_required even after 60s
|
||||
await act(async () => {
|
||||
@@ -92,7 +96,9 @@ describe('useShellInactivityStatus', () => {
|
||||
isRedirectionActive: true,
|
||||
});
|
||||
|
||||
const { result } = renderHook(() => useShellInactivityStatus(defaultProps));
|
||||
const { result } = await renderHook(() =>
|
||||
useShellInactivityStatus(defaultProps),
|
||||
);
|
||||
|
||||
// Even after delay, focus hint should be suppressed
|
||||
await act(async () => {
|
||||
|
||||
Reference in New Issue
Block a user