From 00805cb2cdd9786451b9a3a6746f11f47535288d Mon Sep 17 00:00:00 2001 From: Jacob Richman Date: Wed, 28 May 2025 19:46:08 +0000 Subject: Cleanup: Remove low value StreamingContextType interface. (#585) --- .../src/ui/components/LoadingIndicator.test.tsx | 23 ++++++---------------- 1 file changed, 6 insertions(+), 17 deletions(-) (limited to 'packages/cli/src/ui/components/LoadingIndicator.test.tsx') diff --git a/packages/cli/src/ui/components/LoadingIndicator.test.tsx b/packages/cli/src/ui/components/LoadingIndicator.test.tsx index c74003e4..3d31818b 100644 --- a/packages/cli/src/ui/components/LoadingIndicator.test.tsx +++ b/packages/cli/src/ui/components/LoadingIndicator.test.tsx @@ -8,10 +8,7 @@ import React from 'react'; import { render } from 'ink-testing-library'; import { Text } from 'ink'; import { LoadingIndicator } from './LoadingIndicator.js'; -import { - StreamingContext, - StreamingContextType, -} from '../contexts/StreamingContext.js'; +import { StreamingContext } from '../contexts/StreamingContext.js'; import { StreamingState } from '../types.js'; import { vi } from 'vitest'; @@ -22,7 +19,7 @@ vi.mock('./GeminiRespondingSpinner.js', () => ({ }: { nonRespondingDisplay?: string; }) => { - const { streamingState } = React.useContext(StreamingContext)!; + const streamingState = React.useContext(StreamingContext)!; if (streamingState === StreamingState.Responding) { return MockRespondingSpinner; } else if (nonRespondingDisplay) { @@ -36,9 +33,7 @@ const renderWithContext = ( ui: React.ReactElement, streamingStateValue: StreamingState, ) => { - const contextValue: StreamingContextType = { - streamingState: streamingStateValue, - }; + const contextValue: StreamingState = streamingStateValue; return render( {ui} @@ -129,9 +124,7 @@ describe('', () => { // Transition to Responding rerender( - + ', () => { // Transition to WaitingForConfirmation rerender( - + ', () => { // Transition back to Idle rerender( - + , ); -- cgit v1.2.3