mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
changes requested
This commit is contained in:
parent
2ac94e1b47
commit
b64c080447
@ -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,
|
||||||
|
|||||||
@ -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 () => {
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user