All files / extensions/dicom-microscopy/src/helpers formatDICOMPatientName.test.js

0% Statements 0/11
100% Branches 0/0
0% Functions 0/3
0% Lines 0/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18                                   
import formatDICOMPatientName from './formatDICOMPatientName';
 
describe('formatDICOMPatientName', () => {
  it('should format DICOM patient name correctly', () => {
    const patientName = 'Blackford^Test';
    const formattedPatientName = formatDICOMPatientName(patientName);
    expect(formattedPatientName).toEqual('Blackford, Test');
  });
 
  it('should return undefined it input is not a string', () => {
    expect(formatDICOMPatientName(123)).toEqual(undefined);
    expect(formatDICOMPatientName(null)).toEqual(undefined);
    expect(formatDICOMPatientName(undefined)).toEqual(undefined);
    expect(formatDICOMPatientName(false)).toEqual(undefined);
    expect(formatDICOMPatientName([])).toEqual(undefined);
  });
});