From 5302d04f220a2ed015eb2f9f22458b989990db6a Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Mon, 24 Feb 2025 09:36:20 -0500 Subject: [PATCH 1/5] CASH-132 tech review updates. --- src/constants/part-number-strings.js | 1 + src/experiment-components/donation-block.vue | 4 - .../service-package-radio.vue | 8 +- .../save-progress-modal-question.vue | 2 +- src/layouts/address-lookup/address-lookup.vue | 9 +- src/layouts/confirmation/confirmation.vue | 14 +- .../insurance-company.spec.js | 137 +++++++++--------- .../license-plate-lookup.vue | 3 +- src/layouts/vin-lookup/vin-lookup.vue | 30 +++- 9 files changed, 105 insertions(+), 103 deletions(-) diff --git a/src/constants/part-number-strings.js b/src/constants/part-number-strings.js index c32864a87..d21ab83ac 100644 --- a/src/constants/part-number-strings.js +++ b/src/constants/part-number-strings.js @@ -2,6 +2,7 @@ const partNumberStrings = { // Recalibration MOBILE_STATIC_RECAL_FEE: "RECAL MOBILE", MOBILE_DUAL_RECAL_FEE: "RECAL MOBILEDUAL", + DONATION: "DONATION", }; export { partNumberStrings }; diff --git a/src/experiment-components/donation-block.vue b/src/experiment-components/donation-block.vue index 10ebec7a5..1daeedc41 100644 --- a/src/experiment-components/donation-block.vue +++ b/src/experiment-components/donation-block.vue @@ -130,10 +130,6 @@ export default { }, methods: { handleDonationAction(submitEvent) { - console.log( - "running handleDonationAction(), submitEvent.target.elements.amount.value: ", - submitEvent.target.elements.amount.value - ); this.selectedValue = submitEvent.target.elements.amount.value; }, }, diff --git a/src/experiment-components/service-package-radio.vue b/src/experiment-components/service-package-radio.vue index 3b9e5d9c9..d972a8433 100644 --- a/src/experiment-components/service-package-radio.vue +++ b/src/experiment-components/service-package-radio.vue @@ -208,7 +208,7 @@ export default { } @include media-breakpoint-up(lg) { &:before { - top: .5rem; + top: 0.5rem; } &:after { top: 1.4375rem; @@ -223,7 +223,7 @@ export default { + .package-label.pricing-by-day-pkg-lbl-ins { &:before { - top: .3125rem; + top: 0.3125rem; } &:after { top: 1.25rem; @@ -234,7 +234,7 @@ export default { &:before { top: 0.9375rem; @include media-breakpoint-up(lg) { - top: .3125rem; + top: 0.3125rem; } } &:after { @@ -258,7 +258,7 @@ export default { min-height: 52px; max-height: 126px; @include media-breakpoint-up(md) { - max-height: 500px; + max-height: 500px; } transition: max-height 0.25s ease-in; diff --git a/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue b/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue index 3628a372c..ebaa5a8be 100644 --- a/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue +++ b/src/fmg-components/save-progress-modal-question/save-progress-modal-question.vue @@ -181,7 +181,7 @@ export default { transition: background 0s 0s ease-in-out; } } - + .modal.modal-component .modal-dialog .modal-content { .modal-header { padding-top: 0; diff --git a/src/layouts/address-lookup/address-lookup.vue b/src/layouts/address-lookup/address-lookup.vue index 08f602fb4..6e3520704 100644 --- a/src/layouts/address-lookup/address-lookup.vue +++ b/src/layouts/address-lookup/address-lookup.vue @@ -361,13 +361,16 @@ export default { if (!this.customerQuestions.emailOrSms) { await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false); await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false); - } - else { + } else { if (vinPagesMixin.methods.isPhoneNumber(this.customerQuestions.emailOrSms)) { const phone = this.customerQuestions.emailOrSms.replace(/[()]/g, ""); await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false); } else { - await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.customerQuestions.emailOrSms, false); + await this.dispatchStoreAction( + storeActions.SAVE_EMAIL, + this.customerQuestions.emailOrSms, + false + ); } } diff --git a/src/layouts/confirmation/confirmation.vue b/src/layouts/confirmation/confirmation.vue index c87da58dd..ac6ce2ed5 100644 --- a/src/layouts/confirmation/confirmation.vue +++ b/src/layouts/confirmation/confirmation.vue @@ -64,7 +64,7 @@ :isItac="isItac" :isNoComp="isNoComp" /> -
+
- -
@@ -122,6 +118,7 @@ import { partTypeStrings } from "@/constants/part-type-strings"; import { containsLineItemWithPartType } from "@/helpers/service-package-helper"; import { containsRecalParts } from "@/helpers/recal-helper.js"; import donationBlock from "@/experiment-components/donation-block.vue"; +import { partNumberStrings } from "@/constants/part-number-strings"; export default { name: "confirmation", @@ -219,7 +216,7 @@ export default { }; const donationItems = lineItemsFromSubmittedOrder.supportingItems?.filter( - (item) => item.partNumber === "DONATION" + (item) => item.partNumber === partNumberStrings.DONATION ); const donationAmount = donationItems?.length > 0 ? donationItems[0].sellingPrice : 0; @@ -532,13 +529,9 @@ export default { "test", false ).catch((error) => { - // this.$refs.navbar.removeLoader(); - console.error("Error!!! error: ", error); return error; }); - console.log("ran addDonation()... (*fake call*) donationResponse: ", donationResponse); - if (donationResponse?.status == "200") { this.showDonationSuccess = true; this.showDonationError = false; @@ -561,7 +554,6 @@ export default { watch: { donationAmount(newValue) { newValue = parseInt(newValue); - console.log("WATCHED donationAmount changed: ", newValue); // this.addDonation(newValue); // TODO - when backend code is final, then remove the below and restore the line above diff --git a/src/layouts/insurance-company/insurance-company.spec.js b/src/layouts/insurance-company/insurance-company.spec.js index b1297d13b..a35be3b87 100644 --- a/src/layouts/insurance-company/insurance-company.spec.js +++ b/src/layouts/insurance-company/insurance-company.spec.js @@ -1,105 +1,102 @@ -import { shallowMount } from '@vue/test-utils'; -import InsuranceCompany from '@/layouts/insurance-company/insurance-company.vue'; -import { applicationConfig } from '@/constants/application-config.js'; +import { shallowMount } from "@vue/test-utils"; +import InsuranceCompany from "@/layouts/insurance-company/insurance-company.vue"; +import { applicationConfig } from "@/constants/application-config.js"; import store from "@/store"; import baseMixin from "@/mixins/base-mixin.js"; - -jest.mock('@/store', () => ({ +jest.mock("@/store", () => ({ getters: { - order: { - payment: { - parentAccountNumber: '12345', + order: { + payment: { + parentAccountNumber: "12345", + }, }, - }, }, - })); +})); var mockRouter = { navigateWithoutSaving: jest.fn(), - }; +}; - jest.mock('@/mixins/base-mixin.js', () => ({ +jest.mock("@/mixins/base-mixin.js", () => ({ methods: { - navigateWithoutSaving: jest.fn(), + navigateWithoutSaving: jest.fn(), }, data() { - return { - navigationScenarios: { - CLICKED_BACK: 'clicked_back', - }, - }; + return { + navigationScenarios: { + CLICKED_BACK: "clicked_back", + }, + }; }, - })); +})); describe("insurance-company.vue", () => { - beforeEach(() => { // Reset the store's parentAccountNumber before each test - store.getters.order.payment.parentAccountNumber = '12345'; - }); + store.getters.order.payment.parentAccountNumber = "12345"; + }); - test('should return true when parentAccountNumber matches CASH_PARENT_ACCOUNT_NUMBER', () => { + test("should return true when parentAccountNumber matches CASH_PARENT_ACCOUNT_NUMBER", () => { applicationConfig.CASH_PARENT_ACCOUNT_NUMBER = "12345"; - const wrapper = shallowMount(InsuranceCompany, { - global: { - mocks: { - $store: store - }, - }, - }); - - expect(wrapper.vm.isCashParentAccountNumber()).toBe(true); - }); - - test('should return false when parentAccountNumber does not match CASH_PARENT_ACCOUNT_NUMBER', () => { - applicationConfig.CASH_PARENT_ACCOUNT_NUMBER = "12345"; - store.getters.order.payment.parentAccountNumber = '67890'; - const wrapper = shallowMount(InsuranceCompany, { - global: { - mocks: { - $store: store, - }, - }, - }); - - expect(wrapper.vm.isCashParentAccountNumber()).toBe(false); - }); - - test('should call navigateWithoutSaving with { isCashSelected: true } when forceCashSelection is true', () => { const wrapper = shallowMount(InsuranceCompany, { global: { - mocks: { - $store: store, - $router: mockRouter, - }, - mixins: [baseMixin], + mocks: { + $store: store, + }, }, - }); + }); + expect(wrapper.vm.isCashParentAccountNumber()).toBe(true); + }); + + test("should return false when parentAccountNumber does not match CASH_PARENT_ACCOUNT_NUMBER", () => { + applicationConfig.CASH_PARENT_ACCOUNT_NUMBER = "12345"; + store.getters.order.payment.parentAccountNumber = "67890"; + const wrapper = shallowMount(InsuranceCompany, { + global: { + mocks: { + $store: store, + }, + }, + }); + + expect(wrapper.vm.isCashParentAccountNumber()).toBe(false); + }); + + test("should call navigateWithoutSaving with { isCashSelected: true } when forceCashSelection is true", () => { + const wrapper = shallowMount(InsuranceCompany, { + global: { + mocks: { + $store: store, + $router: mockRouter, + }, + mixins: [baseMixin], + }, + }); wrapper.vm.backButtonAction(true); expect(mockRouter.navigateWithoutSaving).toHaveBeenCalledWith( - wrapper.vm.navigationScenarios.CLICKED_BACK, - wrapper.vm.$route, - { isCashSelected: true } + wrapper.vm.navigationScenarios.CLICKED_BACK, + wrapper.vm.$route, + { isCashSelected: true } ); - }); - - test('should call navigateWithoutSaving with no extra parameter when forceCashSelection is false', () => { + }); + + test("should call navigateWithoutSaving with no extra parameter when forceCashSelection is false", () => { const wrapper = shallowMount(InsuranceCompany, { global: { - mocks: { - $store: store, - $router: mockRouter, + mocks: { + $store: store, + $router: mockRouter, + }, + mixins: [baseMixin], }, - mixins: [baseMixin], - }, - }); + }); wrapper.vm.backButtonAction(false); expect(mockRouter.navigateWithoutSaving).toHaveBeenCalledWith( - wrapper.vm.navigationScenarios.CLICKED_BACK, - wrapper.vm.$route + wrapper.vm.navigationScenarios.CLICKED_BACK, + wrapper.vm.$route ); - }); + }); }); diff --git a/src/layouts/license-plate-lookup/license-plate-lookup.vue b/src/layouts/license-plate-lookup/license-plate-lookup.vue index 6f6521dde..8b9c83c67 100644 --- a/src/layouts/license-plate-lookup/license-plate-lookup.vue +++ b/src/layouts/license-plate-lookup/license-plate-lookup.vue @@ -315,8 +315,7 @@ export default { if (!this.emailOrSms) { await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false); await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false); - } - else { + } else { if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) { const phone = this.emailOrSms.replace(/[()]/g, ""); await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false); diff --git a/src/layouts/vin-lookup/vin-lookup.vue b/src/layouts/vin-lookup/vin-lookup.vue index 2c93e7182..f913993b2 100644 --- a/src/layouts/vin-lookup/vin-lookup.vue +++ b/src/layouts/vin-lookup/vin-lookup.vue @@ -334,13 +334,20 @@ export default { if (!this.emailOrSms) { await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false); await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false); - } - else { + } else { if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) { const phone = this.emailOrSms.replace(/[()]/g, ""); - await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false); + await this.dispatchStoreAction( + storeActions.SAVE_PHONE_NUMBER, + phone, + false + ); } else { - await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false); + await this.dispatchStoreAction( + storeActions.SAVE_EMAIL, + this.emailOrSms, + false + ); } } @@ -391,13 +398,20 @@ export default { if (!this.emailOrSms) { await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, "", false); await this.dispatchStoreAction(storeActions.SAVE_EMAIL, "", false); - } - else { + } else { if (vinPagesMixin.methods.isPhoneNumber(this.emailOrSms)) { const phone = this.emailOrSms.replace(/[()]/g, ""); - await this.dispatchStoreAction(storeActions.SAVE_PHONE_NUMBER, phone, false); + await this.dispatchStoreAction( + storeActions.SAVE_PHONE_NUMBER, + phone, + false + ); } else { - await this.dispatchStoreAction(storeActions.SAVE_EMAIL, this.emailOrSms, false); + await this.dispatchStoreAction( + storeActions.SAVE_EMAIL, + this.emailOrSms, + false + ); } } From c7ac17eb8a1d95a3210e8abbd8e6f75ec4bf86c0 Mon Sep 17 00:00:00 2001 From: Scott Kiener Date: Mon, 24 Feb 2025 10:00:04 -0500 Subject: [PATCH 2/5] Add new prettier container --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 23d5e6806..9d81b3236 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,7 +22,7 @@ resources: - container: awscli image: packagerepository.sagaws.net:8082/safelite/awscli2-build:3.9 - container: prettier-node - image: packagerepository.sagaws.net:8082/safelite/prettier-node-build:18 + image: packagerepository.sagaws.net:8082/safelite/prettier-node-build:23 repositories: - repository: AzureDevOps type: github From 05d55cbe43dcd48e5879a5f1236396d735953b0f Mon Sep 17 00:00:00 2001 From: CarlNation Date: Mon, 24 Feb 2025 10:12:32 -0500 Subject: [PATCH 3/5] CASH-286 CASH-286 - change to 'as low as' for insurance --- .../service-package-radio.vue | 17 ++++++----------- .../save-progress-modal-question.vue | 2 +- .../service-package-question.spec.js | 2 +- .../service-package-question.vue | 12 +++++++----- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/experiment-components/service-package-radio.vue b/src/experiment-components/service-package-radio.vue index c52a80121..6d598adaf 100644 --- a/src/experiment-components/service-package-radio.vue +++ b/src/experiment-components/service-package-radio.vue @@ -1,10 +1,9 @@