Include Mobile_Insurance

This commit is contained in:
Bill Richardson 2023-10-05 11:42:05 -04:00
parent 19bc2e7d2d
commit 121cda7182
2 changed files with 50 additions and 1 deletions

View file

@ -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) => {

View file

@ -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);
});
});
});