mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
fix
This commit is contained in:
parent
f03f428477
commit
dfb85d036b
@ -497,28 +497,6 @@ describe('ContributionResolver', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('throws an error', async () => {
|
||||
jest.clearAllMocks()
|
||||
const { errors: errorObjects } = await mutate({
|
||||
mutation: adminUpdateContribution,
|
||||
variables: {
|
||||
id: pendingContribution.data.createContribution.id,
|
||||
amount: 10.0,
|
||||
memo: 'Test env contribution',
|
||||
creationDate: new Date().toString(),
|
||||
},
|
||||
})
|
||||
expect(errorObjects).toEqual([
|
||||
new GraphQLError('An admin is not allowed to update an user contribution'),
|
||||
])
|
||||
})
|
||||
|
||||
it('logs the error "An admin is not allowed to update an user contribution"', () => {
|
||||
expect(logger.error).toBeCalledWith(
|
||||
'An admin is not allowed to update an user contribution',
|
||||
)
|
||||
})
|
||||
|
||||
describe('contribution has wrong status', () => {
|
||||
beforeAll(async () => {
|
||||
const contribution = await Contribution.findOneOrFail({
|
||||
@ -2824,7 +2802,8 @@ describe('ContributionResolver', () => {
|
||||
} = await query({
|
||||
query: adminListContributions,
|
||||
})
|
||||
// console.log('17 contributions: %s', JSON.stringify(contributionListObject, null, 2))
|
||||
// console.log('18 contributions: %s', JSON.stringify(contributionListObject, null, 2))
|
||||
// console.log(contributionListObject)
|
||||
expect(contributionListObject.contributionList).toHaveLength(18)
|
||||
expect(contributionListObject).toMatchObject({
|
||||
contributionCount: 18,
|
||||
|
||||
@ -19,7 +19,7 @@ export class UnconfirmedContributionUserRole extends UnconfirmedContributionRole
|
||||
this.self.contributionStatus = ContributionStatus.PENDING
|
||||
this.self.updatedAt = new Date()
|
||||
// null because updated by user them self
|
||||
this.self.updatedBy = undefined
|
||||
this.self.updatedBy = null
|
||||
}
|
||||
|
||||
public checkAuthorization(user: User): UnconfirmedContributionRole {
|
||||
|
||||
@ -85,8 +85,8 @@ export class Contribution extends BaseEntity {
|
||||
@Column({ nullable: true, name: 'updated_at' })
|
||||
updatedAt: Date
|
||||
|
||||
@Column({ nullable: true, unsigned: true, name: 'updated_by' })
|
||||
updatedBy?: number
|
||||
@Column({ nullable: true, unsigned: true, name: 'updated_by', type: 'int' })
|
||||
updatedBy: number | null
|
||||
|
||||
@DeleteDateColumn({ name: 'deleted_at' })
|
||||
deletedAt: Date | null
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user