CSR-98 Cleanup

This commit is contained in:
Katie 2022-03-30 13:15:51 -04:00
parent 1e40e0e1f8
commit 5803b4dcbb
3 changed files with 3 additions and 10 deletions

View file

@ -26,15 +26,11 @@ export function updateOrCreateFunnelCookie() {
Returns null if cookie isn't valid JSON.
*/
export function getFunnelCookie() {
console.log("getConceptCookie")
console.log(document.cookie)
console.log(location.hostname)
console.log(getDomainWithoutSubdomain())
const cookieJson = document.cookie
?.split("; ")
?.find(row => row.startsWith(`${cookieNames.FUNNEL_SESSION_INFO}=`))
?.split("=")[1];
console.log(cookieJson)
try {
return JSON.parse(cookieJson);
} catch (error) {
@ -75,7 +71,7 @@ export function getCookieDomainValue() {
function getDomainWithoutSubdomain() {
let url = location.hostname;
if (url == "localhost") {
if (url.includes("localhost")) {
return "localhost";
}

View file

@ -67,9 +67,6 @@ export async function navigateToHeritageFunnel() {
{
corid: store.getters.order.referralCorrelationId,
src: "concept-funnel",
// TODO CSR-28, remove this
cns: "all",
experiments: "RemoveServiceAreaPage=ServAreaRemoval_V7=ServAreaNoRemove_V7_TEST=true,ConceptFunnel=ConceptFunnel_V1=ConceptFunnel_TEST=true"
}
);
}

View file

@ -19,7 +19,7 @@ describe("loadOrderIfPresent", () => {
ShouldResetState: testShouldResetState
}
document.cookie = `${cookieNames.ORDER_INFO}=${JSON.stringify(testCookieValue)}; path=/; domain=.safelite.com`;
document.cookie = `${cookieNames.ORDER_INFO}=${JSON.stringify(testCookieValue)}; path=/; ${cookieHelper.getCookieDomainValue()}`;
// Act
loadOrderIfPresent();