All files / extensions/dicom-pdf/src getSopClassHandlerModule.test.js

0% Statements 0/9
100% Branches 0/0
0% Functions 0/3
0% Lines 0/8

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 19 20 21 22 23 24 25 26 27 28                                                       
import getSopClassHandlerModule from './getSopClassHandlerModule';
 
const [pdfHandler] = getSopClassHandlerModule();
const pdf = SOPInstanceUID => ({
  SOPInstanceUID,
  SOPClassUID: '1.2.840.10008.5.1.4.1.1.104.1',
  Modality: 'DOC',
  SeriesInstanceUID: '1.2.3',
  StudyInstanceUID: '1.2',
});
 
describe('dicom-pdf extendDisplaySet', () => {
  // A split rule groups a revision chain into one display set, with the
  // active revision named by `activeSopInstanceUid`.
  it.each([
    ['the instance that activeSopInstanceUid names', 'pdf-2', 'pdf-2'],
    ['the last instance without activeSopInstanceUid', undefined, 'pdf-3'],
  ])('loads %s', (_label, activeSopInstanceUid, expected) => {
    const displaySet = {
      instances: [pdf('pdf-1'), pdf('pdf-2'), pdf('pdf-3')],
      activeSopInstanceUid,
    };
    pdfHandler.extendDisplaySet(displaySet, {});
    expect(displaySet.instance.SOPInstanceUID).toBe(expected);
    expect(displaySet.SOPInstanceUID).toBe(expected);
  });
});