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.0 KB
Raw Blame
import { describe, expect, it } from 'vitest'
import {
  buildNativeChatSubscriptionId,
  buildNativeChatUnsubscribe
} from './native-chat-stream-unsubscribe'

describe('native-chat stream unsubscribe key builder', () => {
  it('derives the cleanup token as agent:sessionId', () => {
    expect(buildNativeChatSubscriptionId('claude', 'sess-1')).toBe('claude:sess-1')
  })

  it('suffixes a per-subscription instance onto the cleanup token', () => {
    expect(buildNativeChatSubscriptionId('claude', 'sess-1', 'sub-7')).toBe('claude:sess-1:sub-7')
  })

  it('builds the unsubscribe RPC frame mobile and web share', () => {
    expect(buildNativeChatUnsubscribe('codex', 'abc')).toEqual({
      method: 'nativeChat.unsubscribe',
      params: { subscriptionId: 'codex:abc' }
    })
  })

  it('echoes a pane-specific token when the subscriber supplied one', () => {
    expect(buildNativeChatUnsubscribe('claude', 'same-session', 'pane-2')).toEqual({
      method: 'nativeChat.unsubscribe',
      params: { subscriptionId: 'pane-2' }
    })
  })
})