mirror of
https://github.com/stablyai/orca.git
synced 2026-11-17 19:34:29 +00:00
test: fixed clock in the terminal override test
This commit is contained in:
@@ -11,20 +11,23 @@ vi.mock('@/components/sidebar/workspace-actions/sleep/use-worktree-sleep-state',
|
||||
useIsSleepingWorktree: () => false
|
||||
}))
|
||||
|
||||
// A fixed clock: the gate reads state, not time.
|
||||
const T0 = 1_800_000_000_000
|
||||
|
||||
const status = (state: HostedWorkspaceStatus['state']): HostedWorkspaceStatus => ({
|
||||
state,
|
||||
metrics: null,
|
||||
uptimeMs: null,
|
||||
usage: { totalMs: 0, centsPerHour: 100, costCents: 0 },
|
||||
archive: null,
|
||||
checkedAt: Date.now()
|
||||
checkedAt: T0
|
||||
})
|
||||
|
||||
function seed(state: HostedWorkspaceStatus['state']): void {
|
||||
seedCloudWorkspaceSnapshot({
|
||||
ids: new Set(['ws']),
|
||||
idsLoaded: true,
|
||||
status: { ws: { status: status(state), loading: false, error: null, fetchedAt: Date.now() } }
|
||||
status: { ws: { status: status(state), loading: false, error: null, fetchedAt: T0 } }
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user