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.

574 B
Raw Blame
import { describe, expect, it } from 'vitest';
import { isCompleteCode, sessionTokenParam } from './email-code';

describe('sessionTokenParam', () => {
  it.each([
    [undefined, undefined],
    ['', undefined],
    ['abc', 'abc'],
    [['old', 'new'], 'new'],
    [[], undefined],
  ])('%o → %o', (value, expected) => {
    expect(sessionTokenParam(value)).toBe(expected);
  });
});

describe('isCompleteCode', () => {
  it('accepts exactly six digits', () => {
    expect(isCompleteCode('12345')).toBe(false);
    expect(isCompleteCode('123456')).toBe(true);
  });
});