commit
12deeb8109
2 changed files with 43 additions and 0 deletions
|
|
@ -523,6 +523,9 @@ export const getters = {
|
|||
);
|
||||
return !!nonWindshieldItems?.length;
|
||||
},
|
||||
isMobileAppointment: (state) => {
|
||||
return state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE;
|
||||
},
|
||||
lineItems: (state) => state.order.lineItems,
|
||||
pageData: (state) => (page) => {
|
||||
return state.applicationUser.pageData[page];
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import { storeMutations } from "@/constants/store-mutations";
|
|||
import { storeActions } from "@/constants/store-actions";
|
||||
import { experimentTriggers } from "@/constants/experiments";
|
||||
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
||||
|
||||
// Mock global method
|
||||
globalMethods.callHttpClient = jest.fn();
|
||||
|
|
@ -2869,6 +2870,45 @@ describe("Getters", () => {
|
|||
expect(getters.payment(storeState).insuranceCoverage.isVerified).toEqual(true);
|
||||
});
|
||||
|
||||
describe("isMobileAppointment", () => {
|
||||
it("Should return true for mobile appointments", () => {
|
||||
// Arrange
|
||||
const storeState = state;
|
||||
|
||||
// Act
|
||||
mutations.updateServiceLocation(storeState, {
|
||||
appointmentType: AppointmentTypeStrings.MOBILE,
|
||||
});
|
||||
|
||||
// Assert
|
||||
expect(getters.isMobileAppointment(storeState)).toBe(true);
|
||||
});
|
||||
|
||||
it("Should return false for non-mobile appointments", () => {
|
||||
// Arrange
|
||||
const storeState = state;
|
||||
|
||||
// Act
|
||||
mutations.updateServiceLocation(storeState, {
|
||||
appointmentType: AppointmentTypeStrings.IN_SHOP,
|
||||
});
|
||||
|
||||
// Assert
|
||||
expect(getters.isMobileAppointment(storeState)).toBe(false);
|
||||
});
|
||||
|
||||
it("Should return false for null appointments", () => {
|
||||
// Arrange
|
||||
const storeState = state;
|
||||
|
||||
// Act
|
||||
mutations.updateServiceLocation(storeState, { appointmentType: null });
|
||||
|
||||
// Assert
|
||||
expect(getters.isMobileAppointment(storeState)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("experimentOrder", () => {
|
||||
test("glassToReplace, glassParts, and otherParts are null > return correct experimentOrder values", () => {
|
||||
// Arrange
|
||||
|
|
|
|||
Loading…
Reference in a new issue