Add nullish check to prevent error when lineItems.glassParts is undefined

This commit is contained in:
Alex Humphries 2026-02-12 12:47:01 -05:00
parent f45b7fbde5
commit 4618f1c4f9
2 changed files with 2 additions and 1 deletions

View file

@ -206,6 +206,7 @@ describe('OrderConfirmation.vue', () => {
useMainStore().getSubmittedOrder = jest.fn().mockImplementation(() => sessionStorage);
};
const { wrapper } = getMountedComponent(initialStore, {}, mockStoreActions);
console.log(wrapper.vm.$refs);
// Act
const arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();

View file

@ -280,7 +280,7 @@ export default {
return content;
},
serviceTypeText() {
const glassPieces = this.submittedOrder.lineItems.glassParts.map((part) => part.partType.toLowerCase());
const glassPieces = this.submittedOrder.lineItems.glassParts?.map((part) => part.partType.toLowerCase()) ?? [];
let glassList = getGlassList(glassPieces);
let workType = '';
if (this.isRepair) {