diff --git a/src/components/Contacts/ContactDetails/ContactDonationsTab/PartnershipInfo/EditPartnershipInfoModal/EditPartnershipInfoModal.test.tsx b/src/components/Contacts/ContactDetails/ContactDonationsTab/PartnershipInfo/EditPartnershipInfoModal/EditPartnershipInfoModal.test.tsx index bc400bff7..cc411a508 100644 --- a/src/components/Contacts/ContactDetails/ContactDonationsTab/PartnershipInfo/EditPartnershipInfoModal/EditPartnershipInfoModal.test.tsx +++ b/src/components/Contacts/ContactDetails/ContactDonationsTab/PartnershipInfo/EditPartnershipInfoModal/EditPartnershipInfoModal.test.tsx @@ -428,6 +428,22 @@ describe('EditPartnershipInfoModal', () => { expect(handleClose).toHaveBeenCalled(); }); + it('should allow for user to remove the start date', async () => { + const { getByLabelText, getByText, findByText } = render(); + const datePickerButton = getByLabelText('Start Date'); + userEvent.click(datePickerButton); + userEvent.click(await findByText('Clear')); + userEvent.click(getByText('Save')); + + await waitFor(() => + expect(mutationSpy).toHaveGraphqlOperation('UpdateContactPartnership', { + attributes: { + pledgeStartDate: null, + }, + }), + ); + }); + it('should handle editing newsletter', async () => { const { getByRole } = render(); diff --git a/src/components/Contacts/ContactDetails/ContactDonationsTab/PartnershipInfo/EditPartnershipInfoModal/EditPartnershipInfoModal.tsx b/src/components/Contacts/ContactDetails/ContactDonationsTab/PartnershipInfo/EditPartnershipInfoModal/EditPartnershipInfoModal.tsx index 6efe37fe0..7b40dc5ab 100644 --- a/src/components/Contacts/ContactDetails/ContactDonationsTab/PartnershipInfo/EditPartnershipInfoModal/EditPartnershipInfoModal.tsx +++ b/src/components/Contacts/ContactDetails/ContactDonationsTab/PartnershipInfo/EditPartnershipInfoModal/EditPartnershipInfoModal.tsx @@ -137,7 +137,7 @@ export const EditPartnershipInfoModal: React.FC< accountListId: accountListId ?? '', attributes: { ...attributes, - pledgeStartDate: attributes.pledgeStartDate?.toISODate(), + pledgeStartDate: attributes.pledgeStartDate?.toISODate() ?? null, nextAsk: attributes.nextAsk?.toISODate() ?? null, primaryPersonId: attributes.primaryPersonId, },