808fde106d
The same AST sweep over specs found fixtures maintained in parallel across suites that have no reason to know about each other. Twenty-one specs each mounted useMessageStream themselves and ten of the harnesses were byte-identical; twenty now take renderMessageStream, with overrides for the seams that genuinely vary. The SessionInfo builder was spelled out field-by-field in seven specs, so a new backend field broke seven files instead of one. Twenty specs carried their own inert ResizeObserver and eleven repeated the animation-frame, CSS.escape, scrollTo and WAAPI stubs the transcript needs to mount at all — split by scope into src/test/jsdom for what any component might need and the assistant-ui folder's own kit for the transcript. Plus the window-state bridge, deferred, the external-store thread runtime, the manual createRoot harness, and the per-folder caret, env-var, provider and session fixtures. Left alone on purpose: the store suites' makePrimary, where the vi.mock harness around it is the actual duplication and cannot be hoisted out of a hoisted factory; electron's deferred, where reaching into src/ from the main process would invert the layering for eight lines; and the two suites that compose another hook alongside the stream.
18 lines
477 B
TypeScript
18 lines
477 B
TypeScript
import type { EnvVarInfo } from '@/types/hermes'
|
|
|
|
/** An unset secret in `category`. The Keys tab and the settings search both
|
|
* bucket by category and branch on `is_set`, so those are what tests vary. */
|
|
export function envVar(category: string, patch: Partial<EnvVarInfo> = {}): EnvVarInfo {
|
|
return {
|
|
advanced: false,
|
|
category,
|
|
description: '',
|
|
is_password: true,
|
|
is_set: false,
|
|
redacted_value: null,
|
|
tools: [],
|
|
url: '',
|
|
...patch
|
|
}
|
|
}
|