Merge branch 'release/2023.03.09' into rlsmerge/2023.03.09-to-develop
This commit is contained in:
commit
a1120943b1
9 changed files with 29 additions and 8 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
const queryStrings = {
|
const queryStrings = {
|
||||||
FMG_PAGE: "fmgPage",
|
FMG_PAGE: "fmgPage",
|
||||||
START_TYPE: "start_type",
|
START_TYPE: "start_type",
|
||||||
|
ZIP_CODE: "zipCode",
|
||||||
};
|
};
|
||||||
|
|
||||||
export { queryStrings };
|
export { queryStrings };
|
||||||
|
|
|
||||||
|
|
@ -258,6 +258,9 @@ function setupMocks({
|
||||||
navigateWithSaving: jest.fn(),
|
navigateWithSaving: jest.fn(),
|
||||||
navigateWithoutSaving: jest.fn(),
|
navigateWithoutSaving: jest.fn(),
|
||||||
},
|
},
|
||||||
|
route: {
|
||||||
|
query: {},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}) {
|
}) {
|
||||||
//Mock CMS Content
|
//Mock CMS Content
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
selectedVinLookupMethod: null,
|
selectedVinLookupMethod: null,
|
||||||
serviceZipCode: this.getZipFromStore(),
|
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipCode,
|
||||||
emailAddress: this.getEmailFromStore(),
|
emailAddress: this.getEmailFromStore(),
|
||||||
displayInvalidZipAlert: false,
|
displayInvalidZipAlert: false,
|
||||||
displayNonServiceableZipAlert: false,
|
displayNonServiceableZipAlert: false,
|
||||||
|
|
|
||||||
|
|
@ -660,6 +660,9 @@ function setupMocks({
|
||||||
navigateWithoutSaving: jest.fn(),
|
navigateWithoutSaving: jest.fn(),
|
||||||
navigateWithSaving: jest.fn(),
|
navigateWithSaving: jest.fn(),
|
||||||
},
|
},
|
||||||
|
route: {
|
||||||
|
query: {},
|
||||||
|
},
|
||||||
store: {
|
store: {
|
||||||
getters: {
|
getters: {
|
||||||
vehicle: {
|
vehicle: {
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
licensePlate: this.getLicensePlateFromStore(),
|
licensePlate: this.getLicensePlateFromStore(),
|
||||||
registrationZipCode: this.getRegistrationZipFromStore(),
|
registrationZipCode: this.getRegistrationZipFromStore() ?? this.$route.query.zipCode,
|
||||||
email: this.getEmailFromStore(),
|
email: this.getEmailFromStore(),
|
||||||
serviceZipCode: this.getServiceZipFromStore(),
|
serviceZipCode: this.getServiceZipFromStore(),
|
||||||
displayNonServiceableZipAlert: false,
|
displayNonServiceableZipAlert: false,
|
||||||
|
|
|
||||||
|
|
@ -149,10 +149,10 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
arePagePrerequisitesValid() {
|
arePagePrerequisitesValid() {
|
||||||
// Check if isRepair is populated and if the pageData we need is here (Parts data)
|
// Check if isRepair is populated and if the pageData we need is here (Parts data)
|
||||||
|
const vehiclePartsFromPageData = store.getters.pageData(fmgPageValues.VEHICLE_PARTS);
|
||||||
return (
|
return (
|
||||||
store.getters.damage.isRepair != null &&
|
store.getters.damage.isRepair != null &&
|
||||||
store.getters.pageData(fmgPageValues.VEHICLE_PARTS) &&
|
vehiclePartsFromPageData?.partsOrQuestions?.some((part) => part?.glassName)
|
||||||
Object.keys(store.getters.pageData(fmgPageValues.VEHICLE_PARTS)).length !== 0
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
async forwardButtonAction() {
|
async forwardButtonAction() {
|
||||||
|
|
|
||||||
|
|
@ -254,6 +254,7 @@ function setupMocks({ customMountOptions }) {
|
||||||
mountOptions.global.mocks["$store"] = store;
|
mountOptions.global.mocks["$store"] = store;
|
||||||
mountOptions.global.mixins = [mockMixin];
|
mountOptions.global.mixins = [mockMixin];
|
||||||
mountOptions["attachTo"] = document.body; // append wrapper to document.body to test DOM methods
|
mountOptions["attachTo"] = document.body; // append wrapper to document.body to test DOM methods
|
||||||
|
mountOptions.route = { query: {} };
|
||||||
|
|
||||||
const wrapper = shallowMount(vinLookup, mountOptions);
|
const wrapper = shallowMount(vinLookup, mountOptions);
|
||||||
mockOutStubFunctions(wrapper);
|
mockOutStubFunctions(wrapper);
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
vin: this.getVinFromStore(),
|
vin: this.getVinFromStore(),
|
||||||
serviceZipCode: this.getZipFromStore(),
|
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipCode,
|
||||||
emailAddress: this.getEmailFromStore(),
|
emailAddress: this.getEmailFromStore(),
|
||||||
isCarIdDifferent: false,
|
isCarIdDifferent: false,
|
||||||
customAlertData: {},
|
customAlertData: {},
|
||||||
|
|
|
||||||
|
|
@ -260,11 +260,24 @@ async function navigate(
|
||||||
|
|
||||||
optionalParams.isSavingNavigation = isSavingNavigation;
|
optionalParams.isSavingNavigation = isSavingNavigation;
|
||||||
|
|
||||||
|
// add querystring params to the route. if they are already in the store then no need to add them
|
||||||
|
var queryStringsObject = {
|
||||||
|
fmgPage: destinationFmgPageValue,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (
|
||||||
|
Object.hasOwn(currentRoute.query, queryStrings.ZIP_CODE) &&
|
||||||
|
(store.getters.order.serviceLocation.zipCode === undefined ||
|
||||||
|
store.getters.order.serviceLocation.zipCode == null) &&
|
||||||
|
(store.getters.order.vehicle.registration.zipCode === undefined ||
|
||||||
|
store.getters.order.vehicle.registration.zipCode == null)
|
||||||
|
) {
|
||||||
|
queryStringsObject[queryStrings.ZIP_CODE] = currentRoute.query.zipCode;
|
||||||
|
}
|
||||||
|
|
||||||
router.push({
|
router.push({
|
||||||
name: "root",
|
name: "root",
|
||||||
query: Object.assign(optionalQuery, {
|
query: Object.assign(optionalQuery, queryStringsObject),
|
||||||
fmgPage: destinationFmgPageValue,
|
|
||||||
}),
|
|
||||||
params: optionalParams,
|
params: optionalParams,
|
||||||
});
|
});
|
||||||
} else if (matchingScenarioMap.destinationUrl !== undefined) {
|
} else if (matchingScenarioMap.destinationUrl !== undefined) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue