diff options
Diffstat (limited to 'packages/cli/src/ui/hooks/shellCommandProcessor.test.ts')
| -rw-r--r-- | packages/cli/src/ui/hooks/shellCommandProcessor.test.ts | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/packages/cli/src/ui/hooks/shellCommandProcessor.test.ts b/packages/cli/src/ui/hooks/shellCommandProcessor.test.ts index 92bc98ea..2fd32087 100644 --- a/packages/cli/src/ui/hooks/shellCommandProcessor.test.ts +++ b/packages/cli/src/ui/hooks/shellCommandProcessor.test.ts @@ -105,9 +105,10 @@ describe('useShellCommandProcessor', () => { it('should return false for non-string input', () => { const { result } = setupHook(); - const handled = result.current.handleShellCommand([ - { text: 'not a string' }, - ] as PartListUnion); + const handled = result.current.handleShellCommand( + [{ text: 'not a string' }] as PartListUnion, + new AbortController().signal, + ); expect(handled).toBe(false); expect(mockAddItemToHistory).not.toHaveBeenCalled(); }); @@ -115,7 +116,10 @@ describe('useShellCommandProcessor', () => { it('should handle empty shell command', () => { const { result } = setupHook(); act(() => { - const handled = result.current.handleShellCommand(''); + const handled = result.current.handleShellCommand( + '', + new AbortController().signal, + ); expect(handled).toBe(true); }); expect(mockAddItemToHistory).toHaveBeenNthCalledWith( @@ -144,7 +148,7 @@ describe('useShellCommandProcessor', () => { existsSyncSpy.mockReturnValue(false); await act(async () => { - result.current.handleShellCommand(command); + result.current.handleShellCommand(command, new AbortController().signal); await new Promise(process.nextTick); }); @@ -182,7 +186,7 @@ describe('useShellCommandProcessor', () => { existsSyncSpy.mockReturnValue(false); await act(async () => { - result.current.handleShellCommand(command); + result.current.handleShellCommand(command, new AbortController().signal); await new Promise(process.nextTick); }); expect(mockAddItemToHistory).toHaveBeenNthCalledWith( @@ -210,7 +214,7 @@ describe('useShellCommandProcessor', () => { existsSyncSpy.mockReturnValue(false); await act(async () => { - result.current.handleShellCommand(command); + result.current.handleShellCommand(command, new AbortController().signal); await new Promise(process.nextTick); }); expect(mockAddItemToHistory).toHaveBeenNthCalledWith( @@ -237,7 +241,7 @@ describe('useShellCommandProcessor', () => { existsSyncSpy.mockReturnValue(false); await act(async () => { - result.current.handleShellCommand(command); + result.current.handleShellCommand(command, new AbortController().signal); await new Promise(process.nextTick); }); expect(mockAddItemToHistory).toHaveBeenNthCalledWith( @@ -264,7 +268,7 @@ describe('useShellCommandProcessor', () => { existsSyncSpy.mockReturnValue(false); await act(async () => { - result.current.handleShellCommand(command); + result.current.handleShellCommand(command, new AbortController().signal); await new Promise(process.nextTick); }); |
