From f7fa3f7c097d8d3c555bf85a3eb27da50f93c4bc Mon Sep 17 00:00:00 2001 From: Karthik chakravarthy <88904658+kcheekuri@users.noreply.github.com> Date: Tue, 5 Oct 2021 16:06:26 -0400 Subject: [PATCH] Fix Unit Test: Mock the class to its instance (#1117) * mock to instance * Update jest.config.js Co-authored-by: Jordi Bunster --- jest.config.js | 4 ++-- src/Utils/GalleryUtils.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jest.config.js b/jest.config.js index 57ec3f489..7e8ceb81e 100644 --- a/jest.config.js +++ b/jest.config.js @@ -37,8 +37,8 @@ module.exports = { global: { branches: 25, functions: 25, - lines: 29.5, - statements: 29.5, + lines: 29, + statements: 29, }, }, diff --git a/src/Utils/GalleryUtils.test.ts b/src/Utils/GalleryUtils.test.ts index 2ba4ac7e3..5b83dd701 100644 --- a/src/Utils/GalleryUtils.test.ts +++ b/src/Utils/GalleryUtils.test.ts @@ -30,7 +30,7 @@ describe("GalleryUtils", () => { }); it("downloadItem shows dialog in data explorer", () => { - const container = {} as Explorer; + const container = new Explorer(); GalleryUtils.downloadItem(container, undefined, galleryItem, undefined); expect(useDialog.getState().visible).toBe(true);