CASH-3105 - changing zip must re-run parts selection when recal ack modal should show

This commit is contained in:
Minojhini Valaiyapathi 2026-08-03 09:33:19 -04:00
parent f4c359ff2c
commit 6797b3fd71
2 changed files with 40 additions and 0 deletions

View file

@ -85,6 +85,7 @@ function setupMocks({ isAppleBrowser = false } = {}) {
CLICKED_FORWARD: "clickedForward", CLICKED_FORWARD: "clickedForward",
CLICKED_FORWARD_WITH_MOBILE_SERVICE: "clickedForwardWithMobileService", CLICKED_FORWARD_WITH_MOBILE_SERVICE: "clickedForwardWithMobileService",
CLICKED_BACK: "clickedBack", CLICKED_BACK: "clickedBack",
ZIP_CODE_CHANGED_RECAL_ACK: "ZIP_CODE_CHANGED_RECAL_ACK",
}; };
}, },
pageName() { pageName() {
@ -284,6 +285,36 @@ describe("scheduling.vue", () => {
expect(wrapper.vm.$refs.schedulingZipSearch.focusZipInput).toHaveBeenCalled(); expect(wrapper.vm.$refs.schedulingZipSearch.focusZipInput).toHaveBeenCalled();
wrapper.unmount(); wrapper.unmount();
}); });
test("navigates to service-zip when zip changes and recal acknowledgement applies", async () => {
store.getters.order.lineItems = {
glassParts: [
{
partType: "WINDSHIELD",
requiresRecalibration: true,
canSafeliteRecalibrate: false,
},
],
};
try {
const { wrapper } = setupMocks();
await wrapper.setData({
isRecalAcknowledgedForScheduling: "",
isLoadingDates: false,
});
await wrapper.vm.onZipSearched({ zipCode: "44101", billToAccountNumber: "87291" });
expect(wrapper.vm.$router.navigateWithSaving).toHaveBeenCalledWith(
"ZIP_CODE_CHANGED_RECAL_ACK",
"scheduling"
);
expect(wrapper.vm.isLoadingDates).toBe(false);
wrapper.unmount();
} finally {
store.getters.order.lineItems = { glassParts: [] };
}
});
}); });
describe("forwardButtonAction", () => { describe("forwardButtonAction", () => {

View file

@ -517,6 +517,15 @@ export default {
this.$refs.schedulingZipSearch?.focusZipInput(); this.$refs.schedulingZipSearch?.focusZipInput();
}, },
async onZipSearched({ zipCode, billToAccountNumber }) { async onZipSearched({ zipCode, billToAccountNumber }) {
// When recal ack applies, changing zip must re-run parts selection via service-zip.
if (this.shouldShowRecalAckModal()) {
this.$router.navigateWithSaving(
this.navigationScenarios.ZIP_CODE_CHANGED_RECAL_ACK,
this.pageName
);
return;
}
this.billToAccountNumber = billToAccountNumber; this.billToAccountNumber = billToAccountNumber;
this.isLoadingDates = true; this.isLoadingDates = true;
try { try {