diff --git a/src/store/index.js b/src/store/index.js index 91ba5f56..79a600e0 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -192,7 +192,8 @@ export const useMainStore = defineStore({ payment: (state) => state.order.payment, policy: (state) => state.order.policy, hasAnyNonWindshieldGlassParts: (state) => !state.order.policy.isDamageGlassOnly, - isMobileAppointment: (state) => state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE, + isMobileAppointment: (state) => state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE + || state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE_INSURANCE, isDropOffAppointment: (state) => state.order.serviceLocation.appointmentType === AppointmentTypeStrings.DROP_OFF, isClaimRegistrationRequired: (state) => state.issConfig.isClaimRegistrationRequired, eventBusItem: (state) => (eventCategory, eventSubCategory) => { diff --git a/src/store/store.spec.js b/src/store/store.spec.js index f736806b..aea99622 100644 --- a/src/store/store.spec.js +++ b/src/store/store.spec.js @@ -1019,6 +1019,18 @@ describe('Store', () => { expect(store.isMobileAppointment).toBe(true); }); + it('Should return true for mobile-insurance appointments', () => { + // Arrange + + // Act + store.updateServiceLocation({ + appointmentType: AppointmentTypeStrings.MOBILE_INSURANCE + }); + + // Assert + expect(store.isMobileAppointment).toBe(true); + }); + it('Should return false for non-mobile appointments', () => { // Arrange @@ -1041,4 +1053,40 @@ describe('Store', () => { expect(store.isMobileAppointment).toBe(false); }); }); + + describe('isDropoffAppointment', () => { + it('Should return true for drop-off appointments', () => { + // Arrange + + // Act + store.updateServiceLocation({ + appointmentType: AppointmentTypeStrings.DROP_OFF + }); + + // Assert + expect(store.isDropOffAppointment).toBe(true); + }); + + it('Should return false for non-drop-off appointments', () => { + // Arrange + + // Act + store.updateServiceLocation({ + appointmentType: AppointmentTypeStrings.MOBILE + }); + + // Assert + expect(store.isDropOffAppointment).toBe(false); + }); + + it('Should return false for null appointments', () => { + // Arrange + + // Act + store.updateServiceLocation({ appointmentType: null }); + + // Assert + expect(store.isDropOffAppointment).toBe(false); + }); + }); });