mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-21 02:32:26 +01:00
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
19 lines
803 B
TypeScript
19 lines
803 B
TypeScript
// Routes every part of the runner dialog reads (catalog, game lookup, jobs).
|
|
|
|
import type { CommandSpec } from '../api/contract'
|
|
import { makeDataset, makeGame } from './factories'
|
|
import { makeInstalled, makeJob, makeStatus } from './fixtures'
|
|
|
|
/** Routes every screen of the dialog reads, plus whatever the test adds. */
|
|
export function routes(specs: CommandSpec[], extra: Record<string, unknown> = {}) {
|
|
return {
|
|
'GET /api/commands': specs,
|
|
'GET /api/dataset': makeDataset([makeGame({ app_id: 7, name: 'Seven' })]),
|
|
'GET /api/installed': { games: [makeInstalled({ app_id: 8, name: 'Eight' }), makeInstalled({ app_id: 9, name: 'Nine', assigned: true })] },
|
|
'GET /api/status': makeStatus(),
|
|
'GET /api/jobs': [],
|
|
'GET /api/jobs/j1': makeJob({ id: 'j1' }),
|
|
...extra,
|
|
}
|
|
}
|