From d8bc145af0427cc2f0521325b1c2a93f18d97ff7 Mon Sep 17 00:00:00 2001 From: Dinesh Katariya Date: Thu, 8 Jun 2023 22:24:33 +0530 Subject: [PATCH] test : improved code by removing ts-ignore had to add any because not able to find exact type --- src/components/ColorPicker/colorPicker.test.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/ColorPicker/colorPicker.test.ts b/src/components/ColorPicker/colorPicker.test.ts index 06d910ee1..87bc7aeed 100644 --- a/src/components/ColorPicker/colorPicker.test.ts +++ b/src/components/ColorPicker/colorPicker.test.ts @@ -69,7 +69,7 @@ describe("isCustomColor", () => { }); describe("getMostUsedCustomColors", () => { - const elements = [ + const elements:readonly any[] = [ { type: "rectangle", id: "1", @@ -109,7 +109,6 @@ describe("getMostUsedCustomColors", () => { it("should return the most used custom colors for element background", () => { const type = "elementBackground"; - // @ts-ignore const result = getMostUsedCustomColors(elements, type, palette); expect(result).toEqual(["#FF0000"]); @@ -118,7 +117,6 @@ describe("getMostUsedCustomColors", () => { it("should return the most used custom colors for element stroke", () => { const type = "elementStroke"; - // @ts-ignore const result = getMostUsedCustomColors(elements, type, palette); expect(result).toEqual(["#00FF00"]); @@ -136,7 +134,6 @@ describe("getMostUsedCustomColors", () => { it("should handle empty palette correctly", () => { const type = "elementBackground"; const emptyPalette = {}; - // @ts-ignore const result = getMostUsedCustomColors(elements, type, emptyPalette); expect(result).toEqual([]);