Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

779 B
Raw Blame
import { describe, expect, it } from 'vitest';
import { formatFieldValue, recordName } from './tool-pipelines';

describe('pipeline tool values', () => {
  it('shows people by email and lists joined', () => {
    expect(formatFieldValue('macro|[email protected]')).toBe('[email protected]');
    expect(formatFieldValue(['macro|[email protected]', 'macro|[email protected]'])).toBe(
      '[email protected], [email protected]'
    );
    expect(formatFieldValue(null)).toBe('empty');
    expect(formatFieldValue(true)).toBe('true');
  });

  it('names a record by name, then detail, then id', () => {
    expect(recordName({ id: '1', name: 'Acme', detail: 'acme.com' })).toBe(
      'Acme'
    );
    expect(recordName({ id: '1', detail: 'acme.com' })).toBe('acme.com');
    expect(recordName({ id: '1' })).toBe('1');
  });
});