From 2e7c7440d387b10228ac77a7f21b9ff594f69880 Mon Sep 17 00:00:00 2001 From: hardiknai-techm <80053762+hardiknai-techm@users.noreply.github.com> Date: Tue, 9 Mar 2021 21:50:14 +0530 Subject: [PATCH] Resolve Lint errors in CommandBarUtil.test.tsx (#529) --- .eslintignore | 3 --- src/Explorer/Menus/CommandBar/CommandBarUtil.test.tsx | 8 +++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.eslintignore b/.eslintignore index 532cc1b96..1b7850a18 100644 --- a/.eslintignore +++ b/.eslintignore @@ -315,10 +315,7 @@ src/Explorer/Graph/GraphExplorerComponent/QueryContainerComponent.tsx src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNeighborsComponent.tsx src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.test.tsx src/Explorer/Graph/GraphExplorerComponent/ReadOnlyNodePropertiesComponent.tsx -src/Explorer/Menus/CommandBar/CommandBarComponentAdapter.tsx -src/Explorer/Menus/CommandBar/CommandBarUtil.test.tsx src/Explorer/Menus/CommandBar/CommandBarUtil.tsx -src/Explorer/Menus/CommandBar/MemoryTrackerComponent.tsx src/Explorer/Menus/NavBar/ControlBarComponent.tsx src/Explorer/Menus/NavBar/ControlBarComponentAdapter.tsx src/Explorer/Menus/NavBar/MeControlComponent.test.tsx diff --git a/src/Explorer/Menus/CommandBar/CommandBarUtil.test.tsx b/src/Explorer/Menus/CommandBar/CommandBarUtil.test.tsx index 4bf2ba645..4a457b67c 100644 --- a/src/Explorer/Menus/CommandBar/CommandBarUtil.test.tsx +++ b/src/Explorer/Menus/CommandBar/CommandBarUtil.test.tsx @@ -1,5 +1,4 @@ import * as CommandBarUtil from "./CommandBarUtil"; -import * as ViewModels from "../../../Contracts/ViewModels"; import { ICommandBarItemProps } from "office-ui-fabric-react/lib/CommandBar"; import { CommandButtonComponentProps } from "../../Controls/CommandButton/CommandButtonComponent"; @@ -26,7 +25,7 @@ describe("CommandBarUtil tests", () => { const converteds = CommandBarUtil.convertButton([btn], backgroundColor); expect(converteds.length).toBe(1); const converted = converteds[0]; - expect(!converted.split); + expect(converted.split).toBe(undefined); expect(converted.iconProps.imageProps.src).toEqual(btn.iconSrc); expect(converted.iconProps.imageProps.alt).toEqual(btn.iconAlt); expect(converted.text).toEqual(btn.commandButtonLabel); @@ -50,7 +49,7 @@ describe("CommandBarUtil tests", () => { const converteds = CommandBarUtil.convertButton([btn], "backgroundColor"); expect(converteds.length).toBe(1); const converted = converteds[0]; - expect(converted.split); + expect(converted.split).toBe(true); expect(converted.subMenuProps.items.length).toBe(btn.children.length); for (let i = 0; i < converted.subMenuProps.items.length; i++) { expect(converted.subMenuProps.items[i].text).toEqual(btn.children[i].commandButtonLabel); @@ -64,7 +63,6 @@ describe("CommandBarUtil tests", () => { } const converteds = CommandBarUtil.convertButton(btns, "backgroundColor"); - const keys = converteds.map((btn: ICommandBarItemProps) => btn.key); const uniqueKeys = converteds .map((btn: ICommandBarItemProps) => btn.key) .filter((value: string, index: number, self: string[]) => self.indexOf(value) === index); @@ -75,7 +73,7 @@ describe("CommandBarUtil tests", () => { const btn = createButton(); const backgroundColor = "backgroundColor"; - btn.commandButtonLabel = null; + btn.commandButtonLabel = undefined; let converted = CommandBarUtil.convertButton([btn], backgroundColor)[0]; expect(converted.text).toEqual(btn.tooltipText);