Add getter to inform cms content
This commit is contained in:
parent
674f2af472
commit
03181bc5ab
2 changed files with 43 additions and 0 deletions
|
|
@ -523,6 +523,9 @@ export const getters = {
|
||||||
);
|
);
|
||||||
return !!nonWindshieldItems?.length;
|
return !!nonWindshieldItems?.length;
|
||||||
},
|
},
|
||||||
|
isMobileAppointment: (state) => {
|
||||||
|
return state.order.serviceLocation.appointmentType === AppointmentTypeStrings.MOBILE;
|
||||||
|
},
|
||||||
lineItems: (state) => state.order.lineItems,
|
lineItems: (state) => state.order.lineItems,
|
||||||
pageData: (state) => (page) => {
|
pageData: (state) => (page) => {
|
||||||
return state.applicationUser.pageData[page];
|
return state.applicationUser.pageData[page];
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import { storeMutations } from "@/constants/store-mutations";
|
||||||
import { storeActions } from "@/constants/store-actions";
|
import { storeActions } from "@/constants/store-actions";
|
||||||
import { experimentTriggers } from "@/constants/experiments";
|
import { experimentTriggers } from "@/constants/experiments";
|
||||||
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
import { fmgPageValues } from "@/router/router-constants/fmgPage-values";
|
||||||
|
import { AppointmentTypeStrings } from "@/constants/schedule-constants";
|
||||||
|
|
||||||
// Mock global method
|
// Mock global method
|
||||||
globalMethods.callHttpClient = jest.fn();
|
globalMethods.callHttpClient = jest.fn();
|
||||||
|
|
@ -2869,6 +2870,45 @@ describe("Getters", () => {
|
||||||
expect(getters.payment(storeState).insuranceCoverage.isVerified).toEqual(true);
|
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", () => {
|
describe("experimentOrder", () => {
|
||||||
test("glassToReplace, glassParts, and otherParts are null > return correct experimentOrder values", () => {
|
test("glassToReplace, glassParts, and otherParts are null > return correct experimentOrder values", () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue