Test that the updateContribution mutation updates the contribution with the right values.

This commit is contained in:
elweyn 2022-07-12 09:55:03 +02:00
parent 9ee40767bb
commit c6ae5760c3
2 changed files with 27 additions and 0 deletions

View File

@ -370,6 +370,32 @@ describe('ContributionResolver', () => {
)
})
})
describe('valid input', () => {
it('updates contribution', async () => {
await expect(
mutate({
mutation: updateContribution,
variables: {
contributionId: result.data.createContribution.id,
amount: 10.0,
memo: 'Test contribution',
creationDate: new Date().toString(),
},
}),
).resolves.toEqual(
expect.objectContaining({
data: {
updateContribution: {
id: result.data.createContribution.id,
amount: '10',
memo: 'Test contribution',
},
},
}),
)
})
})
})
})
})

View File

@ -249,6 +249,7 @@ export const updateContribution = gql`
memo: $memo
creationDate: $creationDate
) {
id
amount
memo
}