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.3 KB
Raw Blame
import { describe, expect, it } from 'vitest'
import {
  brandEphemeralSetupTerminalWorktreeId,
  isEphemeralSetupTerminalWorktreeId
} from './ephemeral-setup-terminal-worktree-id'

describe('ephemeral setup terminal worktree id', () => {
  it('brands a panel id with the ephemeral prefix', () => {
    expect(brandEphemeralSetupTerminalWorktreeId('feature-wall-orchestration-skill-terminal')).toBe(
      'ephemeral-setup-terminal:feature-wall-orchestration-skill-terminal'
    )
  })

  it('is idempotent for already-branded ids', () => {
    const branded = brandEphemeralSetupTerminalWorktreeId('settings-orchestration-skill-terminal')
    expect(brandEphemeralSetupTerminalWorktreeId(branded)).toBe(branded)
  })

  it('recognizes branded ids and rejects real worktree ids', () => {
    expect(
      isEphemeralSetupTerminalWorktreeId(
        brandEphemeralSetupTerminalWorktreeId('feature-tip-cli-skills-terminal')
      )
    ).toBe(true)
    expect(isEphemeralSetupTerminalWorktreeId('repo-1::/work/orca/wt')).toBe(false)
    expect(isEphemeralSetupTerminalWorktreeId('global-floating-terminal')).toBe(false)
  })

  it('does not introduce the `::` worktree id separator', () => {
    expect(brandEphemeralSetupTerminalWorktreeId('onboarding-inline-terminal')).not.toContain('::')
  })
})