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 + ); } ); });