From 8700ca9e3e63c8c07256784f4d3873db8a87c3f3 Mon Sep 17 00:00:00 2001 From: Katie Date: Fri, 27 May 2022 14:38:45 -0400 Subject: [PATCH 1/3] CSR-622 Don't load if referralNumber is empty --- src/helpers/heritage-integration/order-helper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/heritage-integration/order-helper.js b/src/helpers/heritage-integration/order-helper.js index d64ab865d..d32d2b570 100644 --- a/src/helpers/heritage-integration/order-helper.js +++ b/src/helpers/heritage-integration/order-helper.js @@ -12,7 +12,7 @@ export async function loadOrderIfPresent() { const funnelCookie = getFunnelCookie(); // Do nothing if there is no cookie or no correlation id. - if (funnelCookie == null || funnelCookie.ReferralCorrelationId == null) { + if (funnelCookie == null || funnelCookie.ReferralCorrelationId == null || !funnelCookie.ReferralNumber) { return null; } From e849a8a58e9aedbf3bb86f1829d96b4cbac6a846 Mon Sep 17 00:00:00 2001 From: Katie Date: Fri, 27 May 2022 14:40:04 -0400 Subject: [PATCH 2/3] CSR-622 Edit comment --- src/helpers/heritage-integration/order-helper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/heritage-integration/order-helper.js b/src/helpers/heritage-integration/order-helper.js index d32d2b570..962550592 100644 --- a/src/helpers/heritage-integration/order-helper.js +++ b/src/helpers/heritage-integration/order-helper.js @@ -11,7 +11,7 @@ import baseMixin from "@/mixins/base-mixin"; export async function loadOrderIfPresent() { const funnelCookie = getFunnelCookie(); - // Do nothing if there is no cookie or no correlation id. + // Do nothing if there is no cookie, correlation id, or referral number. if (funnelCookie == null || funnelCookie.ReferralCorrelationId == null || !funnelCookie.ReferralNumber) { return null; } From f03e0737f872d190c2339ca85b3c082a0befa29a Mon Sep 17 00:00:00 2001 From: Katie Date: Fri, 27 May 2022 15:16:45 -0400 Subject: [PATCH 3/3] CSR-622 Fix tests --- src/helpers/heritage-integration/order-helper.spec.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/helpers/heritage-integration/order-helper.spec.js b/src/helpers/heritage-integration/order-helper.spec.js index b66286d50..7d769a8d8 100644 --- a/src/helpers/heritage-integration/order-helper.spec.js +++ b/src/helpers/heritage-integration/order-helper.spec.js @@ -18,7 +18,8 @@ describe("loadOrderIfPresent", () => { const testCookieValue = { ShouldResetState: testShouldResetState, - ReferralCorrelationId: "xxx" + ReferralCorrelationId: "xxx", + ReferralNumber: "12345" } document.cookie = `${cookieNames.FUNNEL_SESSION_INFO}=${JSON.stringify(testCookieValue)}; path=/; ${cookieHelper.getCookieDomainValue()}`; @@ -33,7 +34,11 @@ describe("loadOrderIfPresent", () => { test("ShouldResetState == true => reset store", () => { // Arrange - cookieHelper.getFunnelCookie = jest.spyOn(cookieHelper, "getFunnelCookie").mockReturnValueOnce({ ShouldResetState: true, ReferralCorrelationId: "xxx-xxx-xxx" }); + cookieHelper.getFunnelCookie = jest.spyOn(cookieHelper, "getFunnelCookie").mockReturnValueOnce({ + ShouldResetState: true, + ReferralCorrelationId: "xxx-xxx-xxx", + ReferralNumber: "12345" + }); const mockData = { actionList: [{