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。

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

import {
  savedCredentialsNoteKey,
  shouldShowSavedCredentialsCard,
} from '@/components/settings/feishuBotPresentation';

describe('Feishu bot saved-credential presentation', () => {
  it('keeps the bound card visible for every transport state when credentials exist', () => {
    expect(shouldShowSavedCredentialsCard(true)).toBe(true);
    expect(shouldShowSavedCredentialsCard(false)).toBe(false);
  });

  it.each([
    ['idle', 'settings.feishuBot.saved.idleNote'],
    ['testing', 'settings.feishuBot.saved.connectingNote'],
    ['connected', 'settings.feishuBot.connected.note'],
    ['reconnecting', 'settings.feishuBot.saved.reconnectingNote'],
    ['conflict', 'settings.feishuBot.saved.conflictNote'],
    ['error', 'settings.feishuBot.saved.errorNote'],
  ] as const)('maps %s to an explicit saved-credential explanation', (status, key) => {
    expect(savedCredentialsNoteKey(status)).toBe(key);
  });
});