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 9cf922388..c1583f4c8 100644 --- a/src/components/Contacts/ContactDetails/ContactDonationsTab/PartnershipInfo/EditPartnershipInfoModal/EditPartnershipInfoModal.test.tsx +++ b/src/components/Contacts/ContactDetails/ContactDonationsTab/PartnershipInfo/EditPartnershipInfoModal/EditPartnershipInfoModal.test.tsx @@ -703,4 +703,35 @@ describe('EditPartnershipInfoModal', () => { ); expect(handleClose).toHaveBeenCalled(); }); + + it('should allow user to remove next ask date', async () => { + const mutationSpy = jest.fn(); + const { getByLabelText, getByText, findByText } = render( + + + + + + + + + , + ); + const datePickerButton = getByLabelText('Next Increase Ask'); + userEvent.click(datePickerButton); + const clearButton = await findByText('Clear'); + userEvent.click(clearButton); + userEvent.click(getByText('Save')); + + await waitFor(() => + expect(mutationSpy).toHaveGraphqlOperation('UpdateContactPartnership', { + attributes: { + nextAsk: null, + }, + }), + ); + }); }); diff --git a/src/components/Contacts/ContactDetails/ContactDonationsTab/PartnershipInfo/EditPartnershipInfoModal/EditPartnershipInfoModal.tsx b/src/components/Contacts/ContactDetails/ContactDonationsTab/PartnershipInfo/EditPartnershipInfoModal/EditPartnershipInfoModal.tsx index 8af1ca3a1..6efe37fe0 100644 --- a/src/components/Contacts/ContactDetails/ContactDonationsTab/PartnershipInfo/EditPartnershipInfoModal/EditPartnershipInfoModal.tsx +++ b/src/components/Contacts/ContactDetails/ContactDonationsTab/PartnershipInfo/EditPartnershipInfoModal/EditPartnershipInfoModal.tsx @@ -138,7 +138,7 @@ export const EditPartnershipInfoModal: React.FC< attributes: { ...attributes, pledgeStartDate: attributes.pledgeStartDate?.toISODate(), - nextAsk: attributes.nextAsk?.toISODate(), + nextAsk: attributes.nextAsk?.toISODate() ?? null, primaryPersonId: attributes.primaryPersonId, }, },