import { generateTreatmentTitle, normalizeTeeth } from './treatment.utils';

describe('treatment.utils', () => {
  it('normalizes valid FDI teeth', () => {
    expect(normalizeTeeth(['45', '14', '14', '99'])).toEqual(['14', '45']);
  });

  it('generates a title from cases', () => {
    expect(
      generateTreatmentTitle([
        { treatmentType: 'filling', teeth: ['14', '15'] },
        { treatmentType: 'endo', teeth: ['45'] },
      ]),
    ).toBe('Filling 14, 15 · Endo 45');
  });
});
