Merge branch 'release/2023.03.09' into rlsmerge/2023.03.09-to-develop

This commit is contained in:
CarlNation 2023-02-24 10:16:44 -05:00
commit a1120943b1
9 changed files with 29 additions and 8 deletions

View file

@ -1,6 +1,7 @@
const queryStrings = {
FMG_PAGE: "fmgPage",
START_TYPE: "start_type",
ZIP_CODE: "zipCode",
};
export { queryStrings };

View file

@ -258,6 +258,9 @@ function setupMocks({
navigateWithSaving: jest.fn(),
navigateWithoutSaving: jest.fn(),
},
route: {
query: {},
},
},
}) {
//Mock CMS Content

View file

@ -132,7 +132,7 @@ export default {
data() {
return {
selectedVinLookupMethod: null,
serviceZipCode: this.getZipFromStore(),
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipCode,
emailAddress: this.getEmailFromStore(),
displayInvalidZipAlert: false,
displayNonServiceableZipAlert: false,

View file

@ -660,6 +660,9 @@ function setupMocks({
navigateWithoutSaving: jest.fn(),
navigateWithSaving: jest.fn(),
},
route: {
query: {},
},
store: {
getters: {
vehicle: {

View file

@ -152,7 +152,7 @@ export default {
data() {
return {
licensePlate: this.getLicensePlateFromStore(),
registrationZipCode: this.getRegistrationZipFromStore(),
registrationZipCode: this.getRegistrationZipFromStore() ?? this.$route.query.zipCode,
email: this.getEmailFromStore(),
serviceZipCode: this.getServiceZipFromStore(),
displayNonServiceableZipAlert: false,

View file

@ -149,10 +149,10 @@ export default {
methods: {
arePagePrerequisitesValid() {
// Check if isRepair is populated and if the pageData we need is here (Parts data)
const vehiclePartsFromPageData = store.getters.pageData(fmgPageValues.VEHICLE_PARTS);
return (
store.getters.damage.isRepair != null &&
store.getters.pageData(fmgPageValues.VEHICLE_PARTS) &&
Object.keys(store.getters.pageData(fmgPageValues.VEHICLE_PARTS)).length !== 0
vehiclePartsFromPageData?.partsOrQuestions?.some((part) => part?.glassName)
);
},
async forwardButtonAction() {

View file

@ -254,6 +254,7 @@ function setupMocks({ customMountOptions }) {
mountOptions.global.mocks["$store"] = store;
mountOptions.global.mixins = [mockMixin];
mountOptions["attachTo"] = document.body; // append wrapper to document.body to test DOM methods
mountOptions.route = { query: {} };
const wrapper = shallowMount(vinLookup, mountOptions);
mockOutStubFunctions(wrapper);

View file

@ -176,7 +176,7 @@ export default {
data() {
return {
vin: this.getVinFromStore(),
serviceZipCode: this.getZipFromStore(),
serviceZipCode: this.getZipFromStore() ?? this.$route.query.zipCode,
emailAddress: this.getEmailFromStore(),
isCarIdDifferent: false,
customAlertData: {},

View file

@ -260,11 +260,24 @@ async function navigate(
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({
name: "root",
query: Object.assign(optionalQuery, {
fmgPage: destinationFmgPageValue,
}),
query: Object.assign(optionalQuery, queryStringsObject),
params: optionalParams,
});
} else if (matchingScenarioMap.destinationUrl !== undefined) {