test(cli): refactor tests for async render utilities (#23252)

This commit is contained in:
Tommaso Sciortino
2026-03-20 20:08:29 +00:00
committed by GitHub
parent 86a3a913b5
commit 6c78eb7a39
198 changed files with 3592 additions and 4802 deletions
@@ -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 () => {