Skip to content

The open-source AI receptionist for businesses. Answers every call, books the appointment and hands over to a person when needed. You own the code and the data.

549 B
Raw Blame
// A member's label (members.ts memberLabel): their name; without one their email where the screen knows it, else
// "A teammate".
import { expect, test } from 'vitest'
import { memberLabel } from './members.ts'

test('the name first, else the email, else A teammate', () => {
  expect(memberLabel({ name: 'Sam Lee' }, '[email protected]')).toBe('Sam Lee')
  expect(memberLabel({ name: '  ' }, '[email protected]')).toBe('[email protected]')
  expect(memberLabel({ name: '' })).toBe('A teammate')
  expect(memberLabel(undefined)).toBe('A teammate')
})