Files
dsh-context/tests/client/overview.fixtures.ts
T
bowenliang123 9aaa11591a test(client): split the oversized specs into siblings with shared harnesses
browser.spec.ts (2360), trendChart.spec.ts (1629), contextView.spec.ts (1504), and
overview.spec.ts (1065) exceeded the 1000-line limit. Each splits along its existing
describe seams into same-directory siblings, with the fixtures that more than one
sibling needs extracted once into a shared harness.

The move is verbatim: test titles, describe blocks, and every assertion line are
preserved exactly (2061 tests before and after, no duplicate titles, no skips), and
the suite reports the same coverage.
2026-10-10 01:21:15 +08:00

25 lines
807 B
TypeScript

import { rangeWindowOf, type OverviewRange, type OverviewRow } from '../../src/client/overview'
import type { SessionCostUsage } from '../../src/shared/types'
/** A preset's resolved scope window at `now` — the page's own resolution, spelled the way the panel spells it. */
export const win = (range: OverviewRange, now: number) => rangeWindowOf(range, now)
export const COST: SessionCostUsage = {
deepseek: { 'deepseek-v4': { peak: { uncached: 100, cacheRead: 50, cacheWrite: 10, output: 40 } } },
}
export function rowOf(over: Partial<OverviewRow> = {}): OverviewRow {
return {
id: 's1',
title: 'session one',
updatedAt: 100,
running: false,
current: false,
timeline: null,
activity: null,
family: [over.timeline ?? null],
familyCost: null,
...over,
}
}