diff --git a/app/shared/reservation-confirmation/ConfirmReservationModal.js b/app/shared/reservation-confirmation/ConfirmReservationModal.js index 156adddf2..24f6c58e1 100644 --- a/app/shared/reservation-confirmation/ConfirmReservationModal.js +++ b/app/shared/reservation-confirmation/ConfirmReservationModal.js @@ -134,6 +134,10 @@ class ConfirmReservationModal extends Component { field => camelCase(field) )]; + if (resource.universalField && resource.universalField.length) { + requiredFormFields.push('universalData'); + } + if (termsAndConditions) { requiredFormFields.push('termsAndConditions'); } diff --git a/app/shared/reservation-confirmation/ConfirmReservationModal.spec.js b/app/shared/reservation-confirmation/ConfirmReservationModal.spec.js index 8a247b8a9..1285a4172 100644 --- a/app/shared/reservation-confirmation/ConfirmReservationModal.spec.js +++ b/app/shared/reservation-confirmation/ConfirmReservationModal.spec.js @@ -215,6 +215,17 @@ describe('shared/reservation-confirmation/ConfirmReservationModal', () => { expect(instance.getRequiredFormFields( resource, null, reservationType)).toStrictEqual(['field1', 'field2']); }); + + test('returns correct array when reservation type is not blocked and resource has universalField', () => { + const reservationType = constants.RESERVATION_TYPE.NORMAL_VALUE; + const resource = Resource.build({ + requiredReservationExtraFields: ['field1', 'field2'], + universalField: [UniversalField.build()], + }); + const instance = getWrapper({ resource, reservationType }).instance(); + expect(instance.getRequiredFormFields( + resource, null, reservationType)).toStrictEqual(['field1', 'field2', 'universalData']); + }); }); /* Field hidden until it is needed again