confirmation email
confirmation email placeholder
This commit is contained in:
parent
b48e0edc7b
commit
9f5612c2f7
5 changed files with 78 additions and 20 deletions
|
|
@ -10,6 +10,7 @@ const applicationConfig = {
|
||||||
PAGE_QUERYSTRING: "fmgPage",
|
PAGE_QUERYSTRING: "fmgPage",
|
||||||
SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass",
|
SITE_ENTRY_TRIGGER_VALUE: "FixMyGlass",
|
||||||
CASH_PARENT_ACCOUNT_NUMBER: 167132,
|
CASH_PARENT_ACCOUNT_NUMBER: 167132,
|
||||||
|
MY_ACCOUNT: process.env.VUE_APP_MY_ACCOUNT,
|
||||||
};
|
};
|
||||||
|
|
||||||
export { applicationConfig };
|
export { applicationConfig };
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import { shallowMount } from "@vue/test-utils";
|
||||||
import { nextTick } from "vue";
|
import { nextTick } from "vue";
|
||||||
import { getMountOptions } from "@/helpers/unit-test-helper.js";
|
import { getMountOptions } from "@/helpers/unit-test-helper.js";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
import router from "@/router";
|
||||||
|
|
||||||
// Mock our module for promises.
|
// Mock our module for promises.
|
||||||
jest.mock("@/helpers/layout-helper.js", () => ({
|
jest.mock("@/helpers/layout-helper.js", () => ({
|
||||||
|
|
@ -54,6 +55,11 @@ beforeEach(() => {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
},
|
},
|
||||||
referralNumber: "1234567",
|
referralNumber: "1234567",
|
||||||
|
vehicle: {
|
||||||
|
year: "2004",
|
||||||
|
make: "Ford",
|
||||||
|
model: "F Series F250",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
payment: {
|
payment: {
|
||||||
isInsurance: true,
|
isInsurance: true,
|
||||||
|
|
@ -71,9 +77,19 @@ afterEach(() => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("confirmation.vue", () => {
|
describe("confirmation.vue", () => {
|
||||||
|
const realLocation = window.location;
|
||||||
|
|
||||||
|
beforeAll(() => {
|
||||||
|
delete window.location;
|
||||||
|
window.location = { ...realLocation, assign: jest.fn() };
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(() => {
|
||||||
|
window.location = realLocation;
|
||||||
|
});
|
||||||
test("arePagePrerequisitesValid should be true ", async () => {
|
test("arePagePrerequisitesValid should be true ", async () => {
|
||||||
//Arrange
|
//Arrange
|
||||||
const { wrapper } = setupMocks();
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
//Act
|
//Act
|
||||||
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
|
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
|
||||||
|
|
@ -82,20 +98,33 @@ describe("confirmation.vue", () => {
|
||||||
//Assert
|
//Assert
|
||||||
expect(arePagePrerequisitesValid).toBe(true);
|
expect(arePagePrerequisitesValid).toBe(true);
|
||||||
});
|
});
|
||||||
|
test("'Back to safelite.com' button should take user back to safelite.com", async () => {
|
||||||
|
//Arrange
|
||||||
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
//Act
|
||||||
|
await wrapper.vm.forwardButtonAction();
|
||||||
|
|
||||||
|
//Assert
|
||||||
|
expect(window.location.assign).toHaveBeenCalled();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function setupMocks() {
|
const wordingText = "wording Text";
|
||||||
const wrapper = shallowMount(
|
function setupMocks({ customMountOptions }) {
|
||||||
confirmation,
|
const mountOptions = getMountOptions({
|
||||||
getMountOptions({
|
...customMountOptions,
|
||||||
router: {
|
});
|
||||||
navigate: jest.fn(),
|
|
||||||
navigate: jest.fn(),
|
|
||||||
navigateWithSaving: jest.fn(),
|
|
||||||
navigateWithoutSaving: jest.fn(),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
|
mountOptions.mixins = [
|
||||||
|
{
|
||||||
|
methods: {
|
||||||
|
getCmsContent: jest.fn().mockImplementation(() => {
|
||||||
|
return wordingText;
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const wrapper = shallowMount(confirmation, mountOptions);
|
||||||
return { wrapper };
|
return { wrapper };
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div v-html="this.getAppointmentWordingText()"></div>
|
<div v-html="this.getAppointmentWordingText()"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-html="this.getConfirmationEmailText()"></div>
|
||||||
<navbar
|
<navbar
|
||||||
cmsWidgetName="FunnelFooterWidget"
|
cmsWidgetName="FunnelFooterWidget"
|
||||||
ref="navbar"
|
ref="navbar"
|
||||||
|
|
@ -58,6 +58,7 @@ import navbar from "@/fmg-components/nav-bar/nav-bar";
|
||||||
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
import { fetchCmsContentForPage } from "@/helpers/cms-content-helper";
|
||||||
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
||||||
import { settleAllPromises } from "@/helpers/layout-helper";
|
import { settleAllPromises } from "@/helpers/layout-helper";
|
||||||
|
import { applicationConfig } from "@/constants/application-config.js";
|
||||||
import store from "@/store";
|
import store from "@/store";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
|
|
@ -94,6 +95,9 @@ export default {
|
||||||
ScheduleConfirmationImage() {
|
ScheduleConfirmationImage() {
|
||||||
return this.getCmsContent("ScheduleConfirmationWidget", "Image");
|
return this.getCmsContent("ScheduleConfirmationWidget", "Image");
|
||||||
},
|
},
|
||||||
|
ConfirmationEmailText() {
|
||||||
|
return this.getCmsContent("ConfirmationEmailWidget", "BodyText");
|
||||||
|
},
|
||||||
ScheduleDate() {
|
ScheduleDate() {
|
||||||
return store.getters.order.schedule.date;
|
return store.getters.order.schedule.date;
|
||||||
},
|
},
|
||||||
|
|
@ -151,6 +155,9 @@ export default {
|
||||||
Model() {
|
Model() {
|
||||||
return store.getters.order.vehicle.model;
|
return store.getters.order.vehicle.model;
|
||||||
},
|
},
|
||||||
|
Email() {
|
||||||
|
return store.getters.order.customer.emailAddress;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
|
|
@ -182,7 +189,9 @@ export default {
|
||||||
|
|
||||||
return serviceLocationReqs && scheduleReqs;
|
return serviceLocationReqs && scheduleReqs;
|
||||||
},
|
},
|
||||||
forwardButtonAction() {},
|
forwardButtonAction() {
|
||||||
|
window.location.assign("//www.safelite.com/");
|
||||||
|
},
|
||||||
getScheduleDate() {
|
getScheduleDate() {
|
||||||
const scheduleDate = new Date(this.ScheduleDate);
|
const scheduleDate = new Date(this.ScheduleDate);
|
||||||
return `${getFullDayName(scheduleDate)}, ${getFullMonthName(
|
return `${getFullDayName(scheduleDate)}, ${getFullMonthName(
|
||||||
|
|
@ -218,6 +227,12 @@ export default {
|
||||||
return this.InShopWordingText.replace("#ADDRESS", address).replace("#YMM", ymm);
|
return this.InShopWordingText.replace("#ADDRESS", address).replace("#YMM", ymm);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
getConfirmationEmailText() {
|
||||||
|
return this.ConfirmationEmailText.replace("#EMAIL", this.Email)
|
||||||
|
.replace("#MY_ACCOUNT_URL", applicationConfig.MY_ACCOUNT)
|
||||||
|
.replace(/</g, "<")
|
||||||
|
.replace(/>/g, ">");
|
||||||
|
},
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
funnelHeader,
|
funnelHeader,
|
||||||
|
|
@ -228,7 +243,6 @@ export default {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|
||||||
.main {
|
.main {
|
||||||
padding: 1rem 0;
|
padding: 1rem 0;
|
||||||
box-shadow: 0 3px 10px rgb(0 0 0 / 0.2);
|
box-shadow: 0 3px 10px rgb(0 0 0 / 0.2);
|
||||||
|
|
@ -250,6 +264,18 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.confirmationEmailText P {
|
||||||
|
margin: 0;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 14px;
|
||||||
|
color: $black;
|
||||||
|
|
||||||
|
+ p {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.calendar-section[data-v-8004c52c] {
|
.calendar-section[data-v-8004c52c] {
|
||||||
display: table;
|
display: table;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ process.env.VUE_APP_HERITAGE_FUNNEL =
|
||||||
process.env.VUE_APP_GOOGLE_PLACES_API_KEY =
|
process.env.VUE_APP_GOOGLE_PLACES_API_KEY =
|
||||||
"AIzaSyDptGCkOPgN2uWJOy4ou4M33phRD4MAoJo";
|
"AIzaSyDptGCkOPgN2uWJOy4ou4M33phRD4MAoJo";
|
||||||
process.env.VUE_APP_CURRENT_ENVIRONMENT = "Localhost";
|
process.env.VUE_APP_CURRENT_ENVIRONMENT = "Localhost";
|
||||||
|
process.env.VUE_APP_MY_ACCOUNT = "https://myaccountdev.safelite.com/";
|
||||||
|
|
||||||
// GA & GTM
|
// GA & GTM
|
||||||
process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY = "(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+ '>m_auth=amlAYNhxUxuskQo7jmjadg>m_preview=env-38>m_cookies_win=x';f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-M6XCRH');";
|
process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY = "(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+ '>m_auth=amlAYNhxUxuskQo7jmjadg>m_preview=env-38>m_cookies_win=x';f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-M6XCRH');";
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ process.env.VUE_APP_CONSUMER_CF_DISTRO = "__VUE_APP_CONSUMER_CF_DISTRO__";
|
||||||
process.env.VUE_APP_GOOGLE_PLACES_API_KEY = "__VUE_APP_GOOGLE_PLACES_API_KEY__";
|
process.env.VUE_APP_GOOGLE_PLACES_API_KEY = "__VUE_APP_GOOGLE_PLACES_API_KEY__";
|
||||||
process.env.VUE_APP_HERITAGE_FUNNEL = "__VUE_APP_HERITAGE_FUNNEL__";
|
process.env.VUE_APP_HERITAGE_FUNNEL = "__VUE_APP_HERITAGE_FUNNEL__";
|
||||||
process.env.VUE_APP_CURRENT_ENVIRONMENT = "__VUE_APP_CURRENT_ENVIRONMENT__";
|
process.env.VUE_APP_CURRENT_ENVIRONMENT = "__VUE_APP_CURRENT_ENVIRONMENT__";
|
||||||
|
process.env.VUE_APP_MY_ACCOUNT = "__VUE_APP_MY_ACCOUNT__";
|
||||||
|
|
||||||
// GA & GTM
|
// GA & GTM
|
||||||
process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY = "__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__";
|
process.env.VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY = "__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__";
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue