From 314cbcd4dfb840955ba23646ea59c379544b6c66 Mon Sep 17 00:00:00 2001 From: Jackie Chan Date: Wed, 17 Nov 2021 15:36:58 -0800 Subject: [PATCH] feat(viewer): use template literal syntax for test.each --- .../iframe/__tests__/IFrameLoader-test.js | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/lib/viewers/iframe/__tests__/IFrameLoader-test.js b/src/lib/viewers/iframe/__tests__/IFrameLoader-test.js index a8cdc4304..b0eb5410e 100644 --- a/src/lib/viewers/iframe/__tests__/IFrameLoader-test.js +++ b/src/lib/viewers/iframe/__tests__/IFrameLoader-test.js @@ -1,8 +1,6 @@ import IFrameLoader from '../IFrameLoader'; import IFrameViewer from '../IFrameViewer'; -const sandbox = sinon.createSandbox(); - describe('lib/viewers/iframe/IFrameLoader', () => { const iframe = new IFrameViewer({ file: { @@ -18,10 +16,6 @@ describe('lib/viewers/iframe/IFrameLoader', () => { }, }); - afterEach(() => { - sandbox.verifyAndRestore(); - }); - test('should have the correct viewer', () => { const iframeViewer = IFrameLoader.viewers[0]; expect(iframeViewer).toEqual({ @@ -32,14 +26,14 @@ describe('lib/viewers/iframe/IFrameLoader', () => { }); }); - test.each([ - // disableDicom, fileType, viewerInstance - [true, 'boxdicom', undefined], - [true, 'boxnote', IFrameLoader.viewers[0]], - [false, 'boxdicom', IFrameLoader.viewers[0]], - ])( + test.each` + disableDicom | fileType | viewerInstance + ${true} | ${'boxdicom'} | ${undefined} + ${true} | ${'boxnote'} | ${IFrameLoader.viewers[0]} + ${false} | ${'boxdicom'} | ${IFrameLoader.viewers[0]} + `( 'should return correct result depending on the disableDicom viewer option and file type', - (disableDicom, fileType, viewerInstance) => { + ({ disableDicom, fileType, viewerInstance }) => { iframe.options.file.extension = fileType; const viewerOptions = {