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.6 KB
Raw Blame
import { describe, expect, it } from 'vitest'
import {
  stripLeadingAgentTitleDecoration,
  stripLeadingAgentTitleDecorationOrEmpty
} from './agent-title-decoration'

describe('stripLeadingAgentTitleDecoration', () => {
  it('strips Qoder permission decoration without stripping triangles inside a title', () => {
    expect(stripLeadingAgentTitleDecoration('▲ Qoder CLI')).toBe('Qoder CLI')
    expect(stripLeadingAgentTitleDecoration('deploy ▲ complete')).toBe('deploy ▲ complete')
  })

  it("strips Claude's ✳ idle glyph", () => {
    expect(stripLeadingAgentTitleDecoration('✳ Claude Code')).toBe('Claude Code')
  })

  it("strips Claude's working/idle text prefixes", () => {
    expect(stripLeadingAgentTitleDecoration('. working on the fix')).toBe('working on the fix')
    expect(stripLeadingAgentTitleDecoration('* Claude Code')).toBe('Claude Code')
  })

  it('strips a leading braille spinner', () => {
    expect(stripLeadingAgentTitleDecoration('⠋ Pi')).toBe('Pi')
  })

  it('leaves an undecorated title untouched', () => {
    expect(stripLeadingAgentTitleDecoration('Dolphin-2')).toBe('Dolphin-2')
    expect(stripLeadingAgentTitleDecoration('npm run dev')).toBe('npm run dev')
  })

  it('keeps the original when the title is only a status glyph', () => {
    expect(stripLeadingAgentTitleDecoration('✳')).toBe('✳')
    expect(stripLeadingAgentTitleDecoration('✳ ')).toBe('✳ ')
  })

  it('can strip to empty when the caller supplies its own fallback label', () => {
    expect(stripLeadingAgentTitleDecorationOrEmpty('✳')).toBe('')
    expect(stripLeadingAgentTitleDecorationOrEmpty('✳ ')).toBe('')
  })
})