mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix contributionResolver tests
This commit is contained in:
parent
08ad0fb1bb
commit
8744ff919e
@ -287,9 +287,10 @@ describe('ContributionResolver', () => {
|
||||
await expect(DbEvent.find()).resolves.toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: EventProtocolType.CONTRIBUTION_CREATE,
|
||||
affectedUserId: bibi.id,
|
||||
actingUserId: bibi.id,
|
||||
involvedContributionId: pendingContribution.data.createContribution.id,
|
||||
amount: expect.decimalEqual(100),
|
||||
contributionId: pendingContribution.data.createContribution.id,
|
||||
userId: bibi.id,
|
||||
}),
|
||||
)
|
||||
})
|
||||
@ -592,9 +593,10 @@ describe('ContributionResolver', () => {
|
||||
await expect(DbEvent.find()).resolves.toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: EventProtocolType.CONTRIBUTION_UPDATE,
|
||||
affectedUserId: bibi.id,
|
||||
actingUserId: bibi.id,
|
||||
involvedContributionId: pendingContribution.data.createContribution.id,
|
||||
amount: expect.decimalEqual(10),
|
||||
contributionId: pendingContribution.data.createContribution.id,
|
||||
userId: bibi.id,
|
||||
}),
|
||||
)
|
||||
})
|
||||
@ -822,9 +824,9 @@ describe('ContributionResolver', () => {
|
||||
await expect(DbEvent.find()).resolves.toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: EventProtocolType.ADMIN_CONTRIBUTION_DENY,
|
||||
userId: bibi.id,
|
||||
xUserId: admin.id,
|
||||
contributionId: contributionToDeny.data.createContribution.id,
|
||||
affectedUserId: bibi.id,
|
||||
actingUserId: admin.id,
|
||||
involvedContributionId: contributionToDeny.data.createContribution.id,
|
||||
amount: expect.decimalEqual(100),
|
||||
}),
|
||||
)
|
||||
@ -937,9 +939,10 @@ describe('ContributionResolver', () => {
|
||||
await expect(DbEvent.find()).resolves.toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: EventProtocolType.CONTRIBUTION_DELETE,
|
||||
contributionId: contributionToDelete.data.createContribution.id,
|
||||
affectedUserId: bibi.id,
|
||||
actingUserId: bibi.id,
|
||||
involvedContributionId: contributionToDelete.data.createContribution.id,
|
||||
amount: expect.decimalEqual(100),
|
||||
userId: bibi.id,
|
||||
}),
|
||||
)
|
||||
})
|
||||
@ -2085,7 +2088,8 @@ describe('ContributionResolver', () => {
|
||||
await expect(DbEvent.find()).resolves.toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: EventProtocolType.ADMIN_CONTRIBUTION_CREATE,
|
||||
userId: admin.id,
|
||||
affectedUserId: bibi.id,
|
||||
actingUserId: admin.id,
|
||||
amount: expect.decimalEqual(200),
|
||||
}),
|
||||
)
|
||||
@ -2329,7 +2333,7 @@ describe('ContributionResolver', () => {
|
||||
mutate({
|
||||
mutation: adminUpdateContribution,
|
||||
variables: {
|
||||
id: creation ? creation.id : -1,
|
||||
id: creation?.id,
|
||||
email: 'peter@lustig.de',
|
||||
amount: new Decimal(300),
|
||||
memo: 'Danke Peter!',
|
||||
@ -2356,7 +2360,8 @@ describe('ContributionResolver', () => {
|
||||
await expect(DbEvent.find()).resolves.toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: EventProtocolType.ADMIN_CONTRIBUTION_UPDATE,
|
||||
userId: admin.id,
|
||||
affectedUserId: creation?.userId,
|
||||
actingUserId: admin.id,
|
||||
amount: 300,
|
||||
}),
|
||||
)
|
||||
@ -2370,7 +2375,7 @@ describe('ContributionResolver', () => {
|
||||
mutate({
|
||||
mutation: adminUpdateContribution,
|
||||
variables: {
|
||||
id: creation ? creation.id : -1,
|
||||
id: creation?.id,
|
||||
email: 'peter@lustig.de',
|
||||
amount: new Decimal(200),
|
||||
memo: 'Das war leider zu Viel!',
|
||||
@ -2397,7 +2402,8 @@ describe('ContributionResolver', () => {
|
||||
await expect(DbEvent.find()).resolves.toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: EventProtocolType.ADMIN_CONTRIBUTION_UPDATE,
|
||||
userId: admin.id,
|
||||
affectedUserId: creation?.userId,
|
||||
actingUserId: admin.id,
|
||||
amount: expect.decimalEqual(200),
|
||||
}),
|
||||
)
|
||||
@ -2562,7 +2568,7 @@ describe('ContributionResolver', () => {
|
||||
mutate({
|
||||
mutation: adminDeleteContribution,
|
||||
variables: {
|
||||
id: creation ? creation.id : -1,
|
||||
id: creation?.id,
|
||||
},
|
||||
}),
|
||||
).resolves.toEqual(
|
||||
@ -2576,7 +2582,9 @@ describe('ContributionResolver', () => {
|
||||
await expect(DbEvent.find()).resolves.toContainEqual(
|
||||
expect.objectContaining({
|
||||
type: EventProtocolType.ADMIN_CONTRIBUTION_DELETE,
|
||||
userId: admin.id,
|
||||
affectedUserId: creation?.userId,
|
||||
actingUserId: admin.id,
|
||||
involvedContributionId: creation?.id,
|
||||
amount: expect.decimalEqual(200),
|
||||
}),
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user