Files
orca/src/shared/profile-state-telemetry-schema.test.ts
T
OrcaWin 82412dab8b Persist profile state in SQLite with background writes (#22612)
Migrate profile state to SQLite and move writes and backups into a background worker. Acknowledge terminal, SSH and automation changes only after durable saves. Preserve JSON import, recovery, rollback and compatibility exports.

Validate migration, worker failures, maintenance, cross-profile moves and terminal lifetime races with unit, integration and end-to-end coverage.
2026-09-25 22:47:33 -07:00

30 lines
888 B
TypeScript

import { describe, expect, it } from 'vitest'
import { eventSchemas } from './telemetry-events'
describe('profile state authority telemetry', () => {
it('accepts the bounded startup selection payload', () => {
expect(
eventSchemas.profile_state_authority_selected.safeParse({
backend: 'sqlite',
classification: 'json-only',
authority_mode: 'sqlite-candidate',
runtime: 'desktop',
migrated: true
}).success
).toBe(true)
})
it('rejects paths or other unbounded diagnostic fields', () => {
expect(
eventSchemas.profile_state_authority_selected.safeParse({
backend: 'sqlite',
classification: 'sqlite-only',
authority_mode: 'sqlite-established',
runtime: 'desktop',
migrated: false,
database_path: '/private/profile.sqlite'
}).success
).toBe(false)
})
})