All files / platform/core/src/utils addProxyFields.test.js

0% Statements 0/9
100% Branches 0/0
0% Functions 0/2
0% Lines 0/9

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                                                   
import dcmjs from 'dcmjs';
import addProxyFields from './addProxyFields';
 
describe('addProxyFields', () => {
  it('reads the shared value, and a denaturalized multiframe dataset has no root copy', () => {
    const instance = addProxyFields({
      SOPClassUID: '1.2.840.10008.5.1.4.1.1.66.4',
      NumberOfFrames: 2,
      SharedFunctionalGroupsSequence: [
        {
          PlaneOrientationSequence: [{ ImageOrientationPatient: [1, 0, 0, 0, 1, 0] }],
          PixelMeasuresSequence: [{ PixelSpacing: [0.5, 0.5], SliceThickness: 1 }],
        },
      ],
    });
 
    expect(instance.ImageOrientationPatient).toEqual([1, 0, 0, 0, 1, 0]);
    expect(instance.PixelSpacing).toEqual([0.5, 0.5]);
 
    const dataset = dcmjs.data.DicomMetaDictionary.denaturalizeDataset(instance);
    expect(dataset).not.toHaveProperty('00200037');
    expect(dataset).not.toHaveProperty('00280030');
    expect(dataset).not.toHaveProperty('00200032');
  });
});