From e0672a91d70fb3e9dc8dcc6c2d883b8e47808dea Mon Sep 17 00:00:00 2001 From: credelinghuys Date: Fri, 1 May 2026 15:50:29 -0400 Subject: [PATCH] CASH-612: Policy vehicle page Co-authored-by: Copilot --- src/constants/insurance.js | 4 ++ .../policy-vehicle/policy-vehicle.spec.js | 15 ++++- src/layouts/policy-vehicle/policy-vehicle.vue | 64 +++++++++++++++++-- src/router/constants/navigation-scenarios.js | 1 + src/router/constants/routing-table.js | 4 ++ 5 files changed, 83 insertions(+), 5 deletions(-) diff --git a/src/constants/insurance.js b/src/constants/insurance.js index f7550513b..5987eb11f 100644 --- a/src/constants/insurance.js +++ b/src/constants/insurance.js @@ -78,3 +78,7 @@ export function coverageTypeEnum(strCoverageType) { return null; } } + +export const parentAccountNumbers = { + CONNECT: "560636", +}; diff --git a/src/layouts/policy-vehicle/policy-vehicle.spec.js b/src/layouts/policy-vehicle/policy-vehicle.spec.js index 1fe1a5559..d11777667 100644 --- a/src/layouts/policy-vehicle/policy-vehicle.spec.js +++ b/src/layouts/policy-vehicle/policy-vehicle.spec.js @@ -50,11 +50,18 @@ function setupMocks() { FunnelHeaderWidget: { Text: "Header" }, FunnelSubHeaderWidget: { Text: "Subheader" }, FunnelFooterWidget: { Text: "Footer" }, + VehicleNotListedWidget: { Text: "Vehicle Not Listed" }, + CancelVerificationWidget: { Text: "Cancel Verification" }, + AmFamDisclaimerWidget: { Text: "Disclaimer" }, }; fetchCmsContentForPage.mockResolvedValue(mockCmsContent); settleAllPromises.mockResolvedValue({ cmsContent: mockCmsContent }); + const getCmsContentMock = jest.fn().mockImplementation((widgetName, cmsFieldName) => { + return mockCmsContent[widgetName][cmsFieldName]; + }); + const mountOptions = getMountOptions({ route: { name: "policy-vehicle", query: {}, params: {} }, router: { @@ -64,7 +71,13 @@ function setupMocks() { }, }); + mountOptions.global = mountOptions.global || {}; + mountOptions.global.mocks = { + ...(mountOptions.global.mocks || {}), + getCmsContent: getCmsContentMock, + }; + const wrapper = shallowMount(policyVehicle, mountOptions); - return { wrapper }; + return { wrapper, getCmsContentMock }; } diff --git a/src/layouts/policy-vehicle/policy-vehicle.vue b/src/layouts/policy-vehicle/policy-vehicle.vue index 954b04bc3..2b87e6692 100644 --- a/src/layouts/policy-vehicle/policy-vehicle.vue +++ b/src/layouts/policy-vehicle/policy-vehicle.vue @@ -4,16 +4,31 @@
- - + + + + + + + +
@@ -24,6 +39,11 @@ import funnelHeader from "@/fmg-components/funnel-header/funnel-header"; import navbar from "@/fmg-components/nav-bar/nav-bar"; import funnelSubHeader from "@/fmg-components/funnel-sub-header/funnel-sub-header"; +import store from "@/store"; +import buttonMain from "@/ux-components/button-main/button-main"; +import textLink from "@/ux-components/text-link/text-link.vue"; +import { parentAccountNumbers } from "@/constants/insurance"; + import { Form } from "vee-validate"; import { fetchCmsContentForPage } from "@/helpers/cms-content-helper"; @@ -40,6 +60,8 @@ export default { funnelHeader, navbar, funnelSubHeader, + textLink, + buttonMain, }, // Ensure CMS content is fetched during route navigation without depending on `to`/`from` async beforeRouteEnter(to, from, next) { @@ -57,7 +79,34 @@ export default { }); }, + computed: { + vehicleNotListedQuestionText() { + return this.getCmsContent("VehicleNotListedWidget", "Text"); + }, + cancelVerificationCopy() { + return this.getCmsContent("CancelVerificationWidget", "Text"); + }, + amFamDisclaimerWidget() { + return this.getCmsContent("AmFamDisclaimerWidget", "Text"); + }, + showAmFamDisclaimer() { + return this.parentAccountNumberFromStore() === this.parentAccountNumbers.CONNECT; + }, + parentAccountNumbers() { + return parentAccountNumbers; + }, + }, + methods: { + parentAccountNumberFromStore() { + return store.getters.order?.payment?.parentAccountNumber; + }, + cancelVerificationAction() { + this.$router.navigateWithoutSaving( + this.navigationScenarios.CLICKED_CANCEL_VERIFICATION, + this.pageName + ); + }, backButtonAction() { this.$router.navigateWithoutSaving( this.navigationScenarios.CLICKED_BACK, @@ -76,3 +125,10 @@ export default { }, }; + + diff --git a/src/router/constants/navigation-scenarios.js b/src/router/constants/navigation-scenarios.js index fef66ddbb..984204e3c 100644 --- a/src/router/constants/navigation-scenarios.js +++ b/src/router/constants/navigation-scenarios.js @@ -12,6 +12,7 @@ const navigationScenarios = { CLICKED_FORWARD: "CLICKED_FORWARD", CLICKED_FORWARD_WITH_CASH: "CLICKED_FORWARD_WITH_CASH", CLICKED_FORWARD_WITH_INSURANCE: "CLICKED_FORWARD_WITH_INSURANCE", + CLICKED_CANCEL_VERIFICATION: "CLICKED_CANCEL_VERIFICATION", // TODO: use virtual page? // Vin selection diff --git a/src/router/constants/routing-table.js b/src/router/constants/routing-table.js index 77876a096..7decd143e 100644 --- a/src/router/constants/routing-table.js +++ b/src/router/constants/routing-table.js @@ -479,6 +479,10 @@ const routingTable = function () { scenario: navigationScenarios.CLICKED_FORWARD, destinationPageData: routeData.POLICY_DRIVER, }, + { + scenario: navigationScenarios.CLICKED_CANCEL_VERIFICATION, + destinationPageData: routeData.INSURANCE_COMPANY, + }, ], }, {