feature: a minimal v1 backend implemented for treatments feature.
This commit is contained in:
16
backend/src/modules/treatments/treatment.utils.spec.ts
Normal file
16
backend/src/modules/treatments/treatment.utils.spec.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
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');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user