Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making the Edit Commitment message different than the add commitment. #1018

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ describe('PledgeModal', () => {

it('Edit commitment', async () => {
const pledgeId = 'pledge-1';
const { getByRole, findByText } = render(
const { getByRole, getByText, findByText } = render(
<Components
pledge={{
id: pledgeId,
Expand All @@ -175,6 +175,7 @@ describe('PledgeModal', () => {
expect(
getByRole('heading', { name: 'Edit Commitment' }),
).toBeInTheDocument();
expect(getByText('You are editing the commitment for')).toBeInTheDocument();

const amountInput = getByRole('textbox', { name: 'Amount' });

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ export const PledgeModal: React.FC<PledgeModalProps> = ({
<Grid item>
<Alert severity="info" sx={{ marginBottom: 1 }}>
<Typography>
{t('You are adding a commitment for')} <b>{contact.name}</b>
{isNewPledge
? t('You are adding a commitment for')
: t('You are editing the commitment for')}
<b> {contact.name}</b>
</Typography>
</Alert>
</Grid>
Expand Down
Loading