changes requested

This commit is contained in:
Moriz Wahl 2023-03-23 13:27:47 +01:00
parent 2ac94e1b47
commit b64c080447
3 changed files with 1 additions and 36 deletions

View File

@ -108,7 +108,6 @@ export default {
}, },
methods: { methods: {
submitCreation() { submitCreation() {
// console.log('submitCreation', this.selected)
this.$apollo this.$apollo
.mutate({ .mutate({
mutation: adminUpdateContribution, mutation: adminUpdateContribution,

View File

@ -2152,39 +2152,6 @@ describe('ContributionResolver', () => {
}) })
}) })
describe.skip('user email does not match creation user', () => {
it('throws an error', async () => {
jest.clearAllMocks()
await expect(
mutate({
mutation: adminUpdateContribution,
variables: {
id: creation ? creation.id : -1,
amount: new Decimal(300),
memo: 'Danke Bibi!',
creationDate: creation
? contributionDateFormatter(creation.contributionDate)
: contributionDateFormatter(new Date()),
},
}),
).resolves.toEqual(
expect.objectContaining({
errors: [
new GraphQLError(
'User of the pending contribution and send user does not correspond',
),
],
}),
)
})
it('logs the error thrown', () => {
expect(logger.error).toBeCalledWith(
'User of the pending contribution and send user does not correspond',
)
})
})
describe('creation update is not valid', () => { describe('creation update is not valid', () => {
// as this test has not clearly defined that date, it is a false positive // as this test has not clearly defined that date, it is a false positive
it('throws an error', async () => { it('throws an error', async () => {

View File

@ -321,7 +321,6 @@ export class ContributionResolver {
const contributionToUpdate = await DbContribution.findOne({ const contributionToUpdate = await DbContribution.findOne({
where: { id, confirmedAt: IsNull(), deniedAt: IsNull() }, where: { id, confirmedAt: IsNull(), deniedAt: IsNull() },
relations: ['user'],
}) })
if (!contributionToUpdate) { if (!contributionToUpdate) {
@ -358,7 +357,7 @@ export class ContributionResolver {
result.date = contributionToUpdate.contributionDate result.date = contributionToUpdate.contributionDate
await EVENT_ADMIN_CONTRIBUTION_UPDATE( await EVENT_ADMIN_CONTRIBUTION_UPDATE(
contributionToUpdate.user, { id: contributionToUpdate.userId } as DbUser,
moderator, moderator,
contributionToUpdate, contributionToUpdate,
amount, amount,