mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix test
This commit is contained in:
parent
6e88068a88
commit
bee05397d2
@ -2695,15 +2695,15 @@ describe('ContributionResolver', () => {
|
|||||||
resetToken()
|
resetToken()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns 19 creations in total', async () => {
|
it('returns 17 creations in total', async () => {
|
||||||
const {
|
const {
|
||||||
data: { adminListAllContributions: contributionListObject },
|
data: { adminListAllContributions: contributionListObject },
|
||||||
}: { data: { adminListAllContributions: ContributionListResult } } = await query({
|
}: { data: { adminListAllContributions: ContributionListResult } } = await query({
|
||||||
query: adminListAllContributions,
|
query: adminListAllContributions,
|
||||||
})
|
})
|
||||||
expect(contributionListObject.contributionList).toHaveLength(19)
|
expect(contributionListObject.contributionList).toHaveLength(17)
|
||||||
expect(contributionListObject).toMatchObject({
|
expect(contributionListObject).toMatchObject({
|
||||||
contributionCount: 19,
|
contributionCount: 17,
|
||||||
contributionList: expect.arrayContaining([
|
contributionList: expect.arrayContaining([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
amount: expect.decimalEqual(50),
|
amount: expect.decimalEqual(50),
|
||||||
@ -2768,24 +2768,6 @@ describe('ContributionResolver', () => {
|
|||||||
messagesCount: 0,
|
messagesCount: 0,
|
||||||
state: 'PENDING',
|
state: 'PENDING',
|
||||||
}),
|
}),
|
||||||
expect.objectContaining({
|
|
||||||
amount: expect.decimalEqual(500),
|
|
||||||
firstName: 'Bibi',
|
|
||||||
id: expect.any(Number),
|
|
||||||
lastName: 'Bloxberg',
|
|
||||||
memo: 'Grundeinkommen',
|
|
||||||
messagesCount: 0,
|
|
||||||
state: 'PENDING',
|
|
||||||
}),
|
|
||||||
expect.objectContaining({
|
|
||||||
amount: expect.decimalEqual(500),
|
|
||||||
firstName: 'Peter',
|
|
||||||
id: expect.any(Number),
|
|
||||||
lastName: 'Lustig',
|
|
||||||
memo: 'Grundeinkommen',
|
|
||||||
messagesCount: 0,
|
|
||||||
state: 'PENDING',
|
|
||||||
}),
|
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
amount: expect.decimalEqual(10),
|
amount: expect.decimalEqual(10),
|
||||||
firstName: 'Bibi',
|
firstName: 'Bibi',
|
||||||
@ -2880,21 +2862,21 @@ describe('ContributionResolver', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns five pending creations with page size set to 5', async () => {
|
it('returns two pending creations with page size set to 2', async () => {
|
||||||
const {
|
const {
|
||||||
data: { adminListAllContributions: contributionListObject },
|
data: { adminListAllContributions: contributionListObject },
|
||||||
}: { data: { adminListAllContributions: ContributionListResult } } = await query({
|
}: { data: { adminListAllContributions: ContributionListResult } } = await query({
|
||||||
query: adminListAllContributions,
|
query: adminListAllContributions,
|
||||||
variables: {
|
variables: {
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 5,
|
pageSize: 2,
|
||||||
order: Order.DESC,
|
order: Order.DESC,
|
||||||
statusFilter: ['PENDING'],
|
statusFilter: ['PENDING'],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
expect(contributionListObject.contributionList).toHaveLength(5)
|
expect(contributionListObject.contributionList).toHaveLength(2)
|
||||||
expect(contributionListObject).toMatchObject({
|
expect(contributionListObject).toMatchObject({
|
||||||
contributionCount: 6,
|
contributionCount: 4,
|
||||||
contributionList: expect.arrayContaining([
|
contributionList: expect.arrayContaining([
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
amount: '400',
|
amount: '400',
|
||||||
@ -2914,33 +2896,6 @@ describe('ContributionResolver', () => {
|
|||||||
messagesCount: 0,
|
messagesCount: 0,
|
||||||
state: 'PENDING',
|
state: 'PENDING',
|
||||||
}),
|
}),
|
||||||
expect.objectContaining({
|
|
||||||
amount: '500',
|
|
||||||
firstName: 'Bibi',
|
|
||||||
id: expect.any(Number),
|
|
||||||
lastName: 'Bloxberg',
|
|
||||||
memo: 'Grundeinkommen',
|
|
||||||
messagesCount: 0,
|
|
||||||
state: 'PENDING',
|
|
||||||
}),
|
|
||||||
expect.objectContaining({
|
|
||||||
amount: '500',
|
|
||||||
firstName: 'Peter',
|
|
||||||
id: expect.any(Number),
|
|
||||||
lastName: 'Lustig',
|
|
||||||
memo: 'Grundeinkommen',
|
|
||||||
messagesCount: 0,
|
|
||||||
state: 'PENDING',
|
|
||||||
}),
|
|
||||||
expect.objectContaining({
|
|
||||||
amount: '100',
|
|
||||||
firstName: 'Peter',
|
|
||||||
id: expect.any(Number),
|
|
||||||
lastName: 'Lustig',
|
|
||||||
memo: 'Test env contribution',
|
|
||||||
messagesCount: 0,
|
|
||||||
state: 'PENDING',
|
|
||||||
}),
|
|
||||||
expect.not.objectContaining({
|
expect.not.objectContaining({
|
||||||
state: 'DENIED',
|
state: 'DENIED',
|
||||||
}),
|
}),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user