From 1bf00f65b8bc642233e392d5ee911ddec7b3fff8 Mon Sep 17 00:00:00 2001 From: Srinath Narayanan Date: Thu, 27 May 2021 10:33:16 +0530 Subject: [PATCH] fixed lint error for MongoIndexPolicyComponentTest --- package.json | 2 +- .../MongoIndexingPolicyComponent.test.tsx | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index aa76dd22d..1727c0d01 100644 --- a/package.json +++ b/package.json @@ -230,4 +230,4 @@ "prettier": { "printWidth": 120 } -} +} \ No newline at end of file diff --git a/src/Explorer/Controls/Settings/SettingsSubComponents/MongoIndexingPolicy/MongoIndexingPolicyComponent.test.tsx b/src/Explorer/Controls/Settings/SettingsSubComponents/MongoIndexingPolicy/MongoIndexingPolicyComponent.test.tsx index 4b123c78a..cd14fca38 100644 --- a/src/Explorer/Controls/Settings/SettingsSubComponents/MongoIndexingPolicy/MongoIndexingPolicyComponent.test.tsx +++ b/src/Explorer/Controls/Settings/SettingsSubComponents/MongoIndexingPolicy/MongoIndexingPolicyComponent.test.tsx @@ -109,12 +109,13 @@ describe("MongoIndexingPolicyComponent", () => { expect(mongoIndexingPolicyComponent.isMongoIndexingPolicyDiscardable()).toEqual( isMongoIndexingPolicyDiscardable ); - if (mongoWarningNotificationMessage) { - const elementAsString = renderToString(mongoIndexingPolicyComponent.getMongoWarningNotificationMessage()); - expect(elementAsString).toContain(mongoWarningNotificationMessage); - } else { - expect(mongoIndexingPolicyComponent.getMongoWarningNotificationMessage()).toBeUndefined(); - } + + const warningNotificationElementAsString = renderToString( + mongoIndexingPolicyComponent.getMongoWarningNotificationMessage() + ); + expect(warningNotificationElementAsString.includes(mongoWarningNotificationMessage)).toEqual( + !!mongoWarningNotificationMessage + ); } ); });