Cleanup: Remove low value StreamingContextType interface. (#585)

This commit is contained in:
Jacob Richman
2025-05-28 19:46:08 +00:00
committed by GitHub
parent 05a49702d8
commit 00805cb2cd
6 changed files with 15 additions and 41 deletions

View File

@@ -9,10 +9,7 @@ import { render } from 'ink-testing-library';
import { ToolMessage, ToolMessageProps } from './ToolMessage.js';
import { StreamingState, ToolCallStatus } from '../../types.js';
import { Text } from 'ink';
import {
StreamingContext,
StreamingContextType,
} from '../../contexts/StreamingContext.js';
import { StreamingContext } from '../../contexts/StreamingContext.js';
// Mock child components or utilities if they are complex or have side effects
vi.mock('../GeminiRespondingSpinner.js', () => ({
@@ -21,7 +18,7 @@ vi.mock('../GeminiRespondingSpinner.js', () => ({
}: {
nonRespondingDisplay?: string;
}) => {
const { streamingState } = React.useContext(StreamingContext)!;
const streamingState = React.useContext(StreamingContext)!;
if (streamingState === StreamingState.Responding) {
return <Text>MockRespondingSpinner</Text>;
}
@@ -48,7 +45,7 @@ const renderWithContext = (
ui: React.ReactElement,
streamingState: StreamingState,
) => {
const contextValue: StreamingContextType = { streamingState };
const contextValue: StreamingState = streamingState;
return render(
<StreamingContext.Provider value={contextValue}>
{ui}