CASH-3105 - changing zip must re-run parts selection when recal ack modal should show
This commit is contained in:
parent
f4c359ff2c
commit
6797b3fd71
2 changed files with 40 additions and 0 deletions
|
|
@ -85,6 +85,7 @@ function setupMocks({ isAppleBrowser = false } = {}) {
|
|||
CLICKED_FORWARD: "clickedForward",
|
||||
CLICKED_FORWARD_WITH_MOBILE_SERVICE: "clickedForwardWithMobileService",
|
||||
CLICKED_BACK: "clickedBack",
|
||||
ZIP_CODE_CHANGED_RECAL_ACK: "ZIP_CODE_CHANGED_RECAL_ACK",
|
||||
};
|
||||
},
|
||||
pageName() {
|
||||
|
|
@ -284,6 +285,36 @@ describe("scheduling.vue", () => {
|
|||
expect(wrapper.vm.$refs.schedulingZipSearch.focusZipInput).toHaveBeenCalled();
|
||||
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", () => {
|
||||
|
|
|
|||
|
|
@ -517,6 +517,15 @@ export default {
|
|||
this.$refs.schedulingZipSearch?.focusZipInput();
|
||||
},
|
||||
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.isLoadingDates = true;
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in a new issue