Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

851 B
Raw Blame
import { describe, expect, it } from 'vitest';

import { IDENTITY_CHANNELS, isChannelAccount, isUnchanneledAccount } from './const';

const mailChannel = IDENTITY_CHANNELS.find((channel) => channel.provider === 'agent-mail')!;

describe('isChannelAccount', () => {
  it('claims an Agent Mail account for the Agent Mail channel', () => {
    expect(isChannelAccount({ kind: 'mail', provider: 'agent-mail' }, mailChannel)).toBe(true);
  });

  it('does not treat a mailbox mounted through another provider as Agent Mail', () => {
    expect(isChannelAccount({ kind: 'mail', provider: 'user' }, mailChannel)).toBe(false);
  });
});

describe('isUnchanneledAccount', () => {
  it('leaves a retired-kind account unchanneled instead of claiming a channel', () => {
    expect(isUnchanneledAccount({ kind: 'phone', provider: 'linq' })).toBe(true);
  });
});