From 076d9f6f90a87f0a3485571cdef18f6ab3522173 Mon Sep 17 00:00:00 2001 From: Jon Snyder Date: Fri, 17 May 2024 14:16:17 -0600 Subject: [PATCH] Return the promise so that Karma waits before executing the next test --- .../createHandleConsentFlicker.spec.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/unit/specs/components/Personalization/createHandleConsentFlicker.spec.js b/test/unit/specs/components/Personalization/createHandleConsentFlicker.spec.js index 5910f2555..2b9a342e3 100644 --- a/test/unit/specs/components/Personalization/createHandleConsentFlicker.spec.js +++ b/test/unit/specs/components/Personalization/createHandleConsentFlicker.spec.js @@ -30,8 +30,8 @@ describe("Personalization::createHandleConsentFlicker", () => { consent.current.and.returnValue({ state: "out", wasSet: true }); handleConsentFlicker(); expect(showContainers).toHaveBeenCalled(); - flushPromiseChains().then(() => { - // expect(consent.awaitConsent).not.toHaveBeenCalled(); + return flushPromiseChains().then(() => { + expect(consent.awaitConsent).not.toHaveBeenCalled(); }); }); @@ -40,8 +40,8 @@ describe("Personalization::createHandleConsentFlicker", () => { consent.awaitConsent.and.returnValue(Promise.reject()); handleConsentFlicker(); expect(consent.awaitConsent).toHaveBeenCalled(); - flushPromiseChains().then(() => { - // expect(showContainers).toHaveBeenCalled(); + return flushPromiseChains().then(() => { + expect(showContainers).toHaveBeenCalled(); }); }); @@ -50,8 +50,8 @@ describe("Personalization::createHandleConsentFlicker", () => { consent.awaitConsent.and.returnValue(Promise.resolve()); handleConsentFlicker(); expect(consent.awaitConsent).toHaveBeenCalled(); - flushPromiseChains().then(() => { - // expect(showContainers).not.toHaveBeenCalled(); + return flushPromiseChains().then(() => { + expect(showContainers).not.toHaveBeenCalled(); }); }); });