Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

1.2 KB
Raw Blame
import { describe, expect, it } from 'vitest';

import { canUseLocalAttachmentPicker } from '../components/new-chat/localAttachmentPicker';

describe('canUseLocalAttachmentPicker', () => {
  it('allows a local new-chat draft before a session exists', () => {
    expect(canUseLocalAttachmentPicker({})).toBe(true);
  });

  it('waits for an existing session identity before exposing controller-local files', () => {
    expect(
      canUseLocalAttachmentPicker({
        sessionId: 'session-loading',
        runtimeAgentKind: null,
      }),
    ).toBe(false);
  });

  it('allows an existing session after its local runtime identity resolves', () => {
    expect(
      canUseLocalAttachmentPicker({
        sessionId: 'session-local',
        runtimeAgentKind: 'claude-code',
      }),
    ).toBe(true);
  });

  it('keeps SSH excluded and allows device-link uploads', () => {
    expect(
      canUseLocalAttachmentPicker({
        sessionId: 'session-ssh',
        runtimeAgentKind: 'claude-code',
        remoteHostId: 'ssh-host',
      }),
    ).toBe(false);
    expect(
      canUseLocalAttachmentPicker({
        runtimeAgentKind: 'codex',
        deviceLinkDeviceId: 'remote-device',
      }),
    ).toBe(true);
  });
});