History

Tighten test fixtures for terminal options and event typing

- Pass subprocess test options only when defined in `terminalManager` tests - Narrow web store terminal event fixtures to `started`/`activity` event shapes

Julius Marminge committed 9 months ago

Commit 804572c1 parent ddc4a932 files · +13 −4Browse files

Showing the changes to apps/web/src (1 of 2 files). Show all

Unified · Split

apps/web/src/store.test.ts+9−2
@@ -5,6 +5,9 @@ import { type AppState, reducer } from "./store"; · 4 unmodified lines
55 import { DEFAULT_THREAD_TERMINAL_HEIGHT, DEFAULT_THREAD_TERMINAL_ID } from "./types";
66 import type { Thread } from "./types";
77
8+type TerminalStartedEvent = Extract<TerminalEvent, { type: "started" }>;
9+type TerminalActivityEvent = Extract<TerminalEvent, { type: "activity" }>;
10+
811 function makeSession(overrides: Partial<ProviderSession> = {}): ProviderSession {
912 return {
1013 sessionId: "sess-1",
@@ -76,7 +79,9 @@ function makeState(thread: Thread): AppState { · 65 unmodified lines
7679 };
7780 }
7881
79−function makeTerminalStartedEvent(overrides: Partial<TerminalEvent> = {}): TerminalEvent {
82+function makeTerminalStartedEvent(
83+ overrides: Partial<TerminalStartedEvent> = {},
84+): TerminalStartedEvent {
8085 return {
8186 type: "started",
8287 threadId: "thread-local-1",
@@ -97,7 +102,9 @@ function makeTerminalStartedEvent(overrides: Partial<TerminalEvent> = {}): Termi · 14 unmodified lines
97102 };
98103 }
99104
100−function makeTerminalActivityEvent(overrides: Partial<TerminalEvent> = {}): TerminalEvent {
105+function makeTerminalActivityEvent(
106+ overrides: Partial<TerminalActivityEvent> = {},
107+): TerminalActivityEvent {
101108 return {
102109 type: "activity",
103110 threadId: "thread-local-1",