Merge pull request #981 from Safelite/rlsmerge/2023.03.09-to-develop
Rlsmerge/2023.03.09 to develop
This commit is contained in:
commit
265da13609
9 changed files with 29 additions and 8 deletions
|
|
@ -1,6 +1,7 @@
|
|||
const queryStrings = {
|
||||
FMG_PAGE: "fmgPage",
|
||||
START_TYPE: "start_type",
|
||||
ZIP_CODE: "zipCode",
|
||||
};
|
||||
|
||||
export { queryStrings };
|
||||
|
|
|
|||
|
|
@ -258,6 +258,9 @@ function setupMocks({
|
|||
navigateWithSaving: jest.fn(),
|
||||
navigateWithoutSaving: jest.fn(),
|
||||
},
|
||||
route: {
|
||||
query: {},
|
||||
},
|
||||
},
|
||||
}) {
|
||||
//Mock CMS Content
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -660,6 +660,9 @@ function setupMocks({
|
|||
navigateWithoutSaving: jest.fn(),
|
||||
navigateWithSaving: jest.fn(),
|
||||
},
|
||||
route: {
|
||||
query: {},
|
||||
},
|
||||
store: {
|
||||
getters: {
|
||||
vehicle: {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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: {},
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue