All files / extensions/dicom-microscopy/src DicomMicroscopySRSopClassHandler.test.js

0% Statements 0/14
100% Branches 0/0
0% Functions 0/4
0% Lines 0/12

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                                                     
import getDicomMicroscopySRSopClassHandler from './DicomMicroscopySRSopClassHandler';
 
jest.mock('./utils/loadSR', () => jest.fn());
 
describe('DicomMicroscopySRSopClassHandler extendDisplaySet', () => {
  it('gives an SR that is not Comprehensive 3D SR to the unsupported handler', () => {
    const unsupported = { extendDisplaySet: jest.fn() };
    const extensionManager = { getModuleEntry: jest.fn(() => unsupported) };
    const handler = getDicomMicroscopySRSopClassHandler({
      servicesManager: { services: {} },
      extensionManager,
    });
    const displaySet = {
      instances: [{ SOPClassUID: '1.2.840.10008.5.1.4.1.1.88.11' }], // Basic Text SR
    };
    const options = { extensionManager, servicesManager: { services: {} } };
 
    handler.extendDisplaySet(displaySet, options);
 
    expect(extensionManager.getModuleEntry).toHaveBeenCalledWith(
      '@ohif/extension-default.sopClassHandlerModule.not-supported-display-sets-handler'
    );
    expect(unsupported.extendDisplaySet).toHaveBeenCalledWith(displaySet, options);
    expect(displaySet.plugin).toBeUndefined();
  });
});