From 9b7f4813fb71b3ee6fad354bbe7c740d593bbb2c Mon Sep 17 00:00:00 2001 From: Daniel Bisgrove Date: Thu, 29 Aug 2024 09:26:50 -0400 Subject: [PATCH] Making the Edit Commitment message different than the add commitment. --- .../Tool/Appeal/Modals/PledgeModal/PledgeModal.test.tsx | 3 ++- .../Tool/Appeal/Modals/PledgeModal/PledgeModal.tsx | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Tool/Appeal/Modals/PledgeModal/PledgeModal.test.tsx b/src/components/Tool/Appeal/Modals/PledgeModal/PledgeModal.test.tsx index be5533c95..0cd003c0c 100644 --- a/src/components/Tool/Appeal/Modals/PledgeModal/PledgeModal.test.tsx +++ b/src/components/Tool/Appeal/Modals/PledgeModal/PledgeModal.test.tsx @@ -155,7 +155,7 @@ describe('PledgeModal', () => { it('Edit commitment', async () => { const pledgeId = 'pledge-1'; - const { getByRole, findByText } = render( + const { getByRole, getByText, findByText } = render( { expect( getByRole('heading', { name: 'Edit Commitment' }), ).toBeInTheDocument(); + expect(getByText('You are editing the commitment for')).toBeInTheDocument(); const amountInput = getByRole('textbox', { name: 'Amount' }); diff --git a/src/components/Tool/Appeal/Modals/PledgeModal/PledgeModal.tsx b/src/components/Tool/Appeal/Modals/PledgeModal/PledgeModal.tsx index 9d8a113a7..03a9d33f8 100644 --- a/src/components/Tool/Appeal/Modals/PledgeModal/PledgeModal.tsx +++ b/src/components/Tool/Appeal/Modals/PledgeModal/PledgeModal.tsx @@ -196,7 +196,10 @@ export const PledgeModal: React.FC = ({ - {t('You are adding a commitment for')} {contact.name} + {isNewPledge + ? t('You are adding a commitment for') + : t('You are editing the commitment for')} + {contact.name}