Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

1.1 KB
Raw Blame
import { describe, expect, it } from 'vitest'
import { profileStateRecoveryRequestSchema } from './profile-state-recovery-command'

describe('offline recovery source selection', () => {
  it.each([
    { kind: 'current-json' },
    { kind: 'latest-json' },
    { kind: 'json', revision: 1 },
    { kind: 'sqlite', backupId: 'selected-backup' }
  ])('accepts an explicit source: %j', (selector) => {
    expect(
      profileStateRecoveryRequestSchema.parse({ userDataPath: '/profile', selector }).selector
    ).toEqual(selector)
  })

  it.each([
    { kind: 'current-json', revision: 1 },
    { kind: 'current-json', backupId: 'selected-backup' },
    { kind: 'current-json', path: '../different-profile/orca-data.json' },
    { kind: 'latest-json', revision: 1 },
    { kind: 'latest-json', backupId: 'selected-backup' },
    { kind: 'json', revision: null },
    { kind: 'json', revision: 0 },
    { kind: 'sqlite' },
    { kind: 'json' }
  ])('rejects ambiguous or incomplete sources: %j', (selector) => {
    expect(
      profileStateRecoveryRequestSchema.safeParse({ userDataPath: '/profile', selector }).success
    ).toBe(false)
  })
})