Test that the updateContribution mutation can not update contribution to a date that is older than 3 month.

This commit is contained in:
elweyn 2022-07-12 09:43:47 +02:00
parent 6348756ab3
commit 9e355f9202

View File

@ -347,6 +347,29 @@ describe('ContributionResolver', () => {
)
})
})
describe('update creation to a date that is older than 3 month', () => {
it('throws an error', async () => {
const date = new Date() // ,
await expect(
mutate({
mutation: updateContribution,
variables: {
contributionId: result.data.createContribution.id,
amount: 1019.0,
memo: 'Test env contribution',
creationDate: date.setMonth(date.getMonth() - 3).toString(),
},
}),
).resolves.toEqual(
expect.objectContaining({
errors: [
new GraphQLError('No information for available creations for the given date'),
],
}),
)
})
})
})
})
})