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

View File

@@ -80,7 +80,7 @@ describe('useSuspend', () => {
setPlatform(originalPlatform);
});
it('cleans terminal state on suspend and restores/repaints on resume in alternate screen mode', () => {
it('cleans terminal state on suspend and restores/repaints on resume in alternate screen mode', async () => {
const handleWarning = vi.fn();
const setRawMode = vi.fn();
const refreshStatic = vi.fn();
@@ -88,7 +88,7 @@ describe('useSuspend', () => {
const enableSupportedModes =
terminalCapabilityManager.enableSupportedModes as unknown as Mock;
const { result, unmount } = renderHook(() =>
const { result, unmount } = await renderHook(() =>
useSuspend({
handleWarning,
setRawMode,
@@ -137,13 +137,13 @@ describe('useSuspend', () => {
unmount();
});
it('does not toggle alternate screen or mouse restore when alternate screen mode is disabled', () => {
it('does not toggle alternate screen or mouse restore when alternate screen mode is disabled', async () => {
const handleWarning = vi.fn();
const setRawMode = vi.fn();
const refreshStatic = vi.fn();
const setForceRerenderKey = vi.fn();
const { result, unmount } = renderHook(() =>
const { result, unmount } = await renderHook(() =>
useSuspend({
handleWarning,
setRawMode,
@@ -169,7 +169,7 @@ describe('useSuspend', () => {
unmount();
});
it('warns and skips suspension on windows', () => {
it('warns and skips suspension on windows', async () => {
setPlatform('win32');
const handleWarning = vi.fn();
@@ -177,7 +177,7 @@ describe('useSuspend', () => {
const refreshStatic = vi.fn();
const setForceRerenderKey = vi.fn();
const { result, unmount } = renderHook(() =>
const { result, unmount } = await renderHook(() =>
useSuspend({
handleWarning,
setRawMode,