mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Rework reviews, add the properties used in the ui for listContributions.
This commit is contained in:
parent
38b7234d96
commit
34fe6b4e90
@ -813,14 +813,15 @@ describe('ContributionResolver', () => {
|
|||||||
id: contributionToDeny.data.createContribution.id,
|
id: contributionToDeny.data.createContribution.id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
expect(isDenied).toBeTruthy()
|
expect(isDenied).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('stores the admin deny contribution event in the database', async () => {
|
it('stores the admin deny contribution event in the database', async () => {
|
||||||
await expect(EventProtocol.find()).resolves.toContainEqual(
|
await expect(EventProtocol.find()).resolves.toContainEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
type: EventProtocolType.ADMIN_CONTRIBUTION_DENY,
|
type: EventProtocolType.ADMIN_CONTRIBUTION_DENY,
|
||||||
userId: admin.id,
|
userId: bibi.id,
|
||||||
|
xUserId: admin.id,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -925,7 +926,7 @@ describe('ContributionResolver', () => {
|
|||||||
id: contributionToDelete.data.createContribution.id,
|
id: contributionToDelete.data.createContribution.id,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
expect(isDenied).toBeTruthy()
|
expect(isDenied).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('stores the CONTRIBUTION_DELETE event in the database', async () => {
|
it('stores the CONTRIBUTION_DELETE event in the database', async () => {
|
||||||
@ -1022,38 +1023,39 @@ describe('ContributionResolver', () => {
|
|||||||
expect(contributionListResult).toMatchObject({
|
expect(contributionListResult).toMatchObject({
|
||||||
contributionCount: 6,
|
contributionCount: 6,
|
||||||
contributionList: expect.arrayContaining([
|
contributionList: expect.arrayContaining([
|
||||||
{
|
expect.objectContaining({
|
||||||
amount: '100',
|
amount: '100',
|
||||||
id: contributionToConfirm.data.createContribution.id,
|
id: contributionToConfirm.data.createContribution.id,
|
||||||
memo: 'Test contribution to confirm',
|
memo: 'Test contribution to confirm',
|
||||||
},
|
}),
|
||||||
{
|
expect.objectContaining({
|
||||||
id: pendingContribution.data.createContribution.id,
|
id: pendingContribution.data.createContribution.id,
|
||||||
memo: 'Test PENDING contribution update',
|
memo: 'Test PENDING contribution update',
|
||||||
amount: '10',
|
amount: '10',
|
||||||
},
|
}),
|
||||||
{
|
expect.objectContaining({
|
||||||
id: contributionToDeny.data.createContribution.id,
|
id: contributionToDeny.data.createContribution.id,
|
||||||
memo: 'Test contribution to deny',
|
memo: 'Test contribution to deny',
|
||||||
amount: '100',
|
amount: '100',
|
||||||
},
|
}),
|
||||||
{
|
expect.objectContaining({
|
||||||
id: contributionToDelete.data.createContribution.id,
|
id: contributionToDelete.data.createContribution.id,
|
||||||
memo: 'Test contribution to delete',
|
memo: 'Test contribution to delete',
|
||||||
amount: '100',
|
amount: '100',
|
||||||
},
|
}),
|
||||||
{
|
expect.objectContaining({
|
||||||
id: inProgressContribution.data.createContribution.id,
|
id: inProgressContribution.data.createContribution.id,
|
||||||
memo: 'Test IN_PROGRESS contribution',
|
memo: 'Test IN_PROGRESS contribution',
|
||||||
amount: '100',
|
amount: '100',
|
||||||
},
|
}),
|
||||||
{
|
expect.objectContaining({
|
||||||
id: bibiCreatedContribution.id,
|
id: bibiCreatedContribution.id,
|
||||||
memo: 'Herzlich Willkommen bei Gradido!',
|
memo: 'Herzlich Willkommen bei Gradido!',
|
||||||
amount: '1000',
|
amount: '1000',
|
||||||
},
|
}),
|
||||||
]),
|
]),
|
||||||
})
|
})
|
||||||
|
expect(contributionListResult.contributionList).toHaveLength(6)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -1074,37 +1076,35 @@ describe('ContributionResolver', () => {
|
|||||||
contributionCount: 4,
|
contributionCount: 4,
|
||||||
contributionList: expect.arrayContaining([
|
contributionList: expect.arrayContaining([
|
||||||
expect.not.objectContaining({
|
expect.not.objectContaining({
|
||||||
amount: '100',
|
state: 'CONFIRMED',
|
||||||
id: contributionToConfirm.data.createContribution.id,
|
|
||||||
memo: 'Test contribution to confirm',
|
|
||||||
}),
|
}),
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
id: pendingContribution.data.createContribution.id,
|
id: pendingContribution.data.createContribution.id,
|
||||||
|
state: 'PENDING',
|
||||||
memo: 'Test PENDING contribution update',
|
memo: 'Test PENDING contribution update',
|
||||||
amount: '10',
|
amount: '10',
|
||||||
}),
|
}),
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
id: contributionToDeny.data.createContribution.id,
|
id: contributionToDeny.data.createContribution.id,
|
||||||
|
state: 'DENIED',
|
||||||
memo: 'Test contribution to deny',
|
memo: 'Test contribution to deny',
|
||||||
amount: '100',
|
amount: '100',
|
||||||
}),
|
}),
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
id: contributionToDelete.data.createContribution.id,
|
id: contributionToDelete.data.createContribution.id,
|
||||||
|
state: 'DELETED',
|
||||||
memo: 'Test contribution to delete',
|
memo: 'Test contribution to delete',
|
||||||
amount: '100',
|
amount: '100',
|
||||||
}),
|
}),
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
id: inProgressContribution.data.createContribution.id,
|
id: inProgressContribution.data.createContribution.id,
|
||||||
|
state: 'IN_PROGRESS',
|
||||||
memo: 'Test IN_PROGRESS contribution',
|
memo: 'Test IN_PROGRESS contribution',
|
||||||
amount: '100',
|
amount: '100',
|
||||||
}),
|
}),
|
||||||
expect.not.objectContaining({
|
|
||||||
id: bibiCreatedContribution.id,
|
|
||||||
memo: 'Herzlich Willkommen bei Gradido!',
|
|
||||||
amount: '1000',
|
|
||||||
}),
|
|
||||||
]),
|
]),
|
||||||
})
|
})
|
||||||
|
expect(contributionListResult.contributionList).toHaveLength(4)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -1253,6 +1253,7 @@ describe('ContributionResolver', () => {
|
|||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
})
|
})
|
||||||
|
expect(contributionListObject.contributionList).toHaveLength(7)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns all contributions for statusFilter = null', async () => {
|
it('returns all contributions for statusFilter = null', async () => {
|
||||||
@ -1317,6 +1318,7 @@ describe('ContributionResolver', () => {
|
|||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
})
|
})
|
||||||
|
expect(contributionListObject.contributionList).toHaveLength(7)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns all contributions for statusFilter = []', async () => {
|
it('returns all contributions for statusFilter = []', async () => {
|
||||||
@ -1381,6 +1383,7 @@ describe('ContributionResolver', () => {
|
|||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
})
|
})
|
||||||
|
expect(contributionListObject.contributionList).toHaveLength(7)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns all CONFIRMED contributions', async () => {
|
it('returns all CONFIRMED contributions', async () => {
|
||||||
@ -1430,6 +1433,7 @@ describe('ContributionResolver', () => {
|
|||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
})
|
})
|
||||||
|
expect(contributionListObject.contributionList).toHaveLength(3)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns all PENDING contributions', async () => {
|
it('returns all PENDING contributions', async () => {
|
||||||
@ -1467,6 +1471,7 @@ describe('ContributionResolver', () => {
|
|||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
})
|
})
|
||||||
|
expect(contributionListObject.contributionList).toHaveLength(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns all IN_PROGRESS Creation', async () => {
|
it('returns all IN_PROGRESS Creation', async () => {
|
||||||
@ -1504,6 +1509,7 @@ describe('ContributionResolver', () => {
|
|||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
})
|
})
|
||||||
|
expect(contributionListObject.contributionList).toHaveLength(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns all DENIED Creation', async () => {
|
it('returns all DENIED Creation', async () => {
|
||||||
@ -1547,6 +1553,7 @@ describe('ContributionResolver', () => {
|
|||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
})
|
})
|
||||||
|
expect(contributionListObject.contributionList).toHaveLength(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('does not return any DELETED Creation', async () => {
|
it('does not return any DELETED Creation', async () => {
|
||||||
@ -1565,6 +1572,7 @@ describe('ContributionResolver', () => {
|
|||||||
contributionCount: 0,
|
contributionCount: 0,
|
||||||
contributionList: [],
|
contributionList: [],
|
||||||
})
|
})
|
||||||
|
expect(contributionListObject.contributionList).toHaveLength(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('returns all CONFIRMED and PENDING Creation', async () => {
|
it('returns all CONFIRMED and PENDING Creation', async () => {
|
||||||
@ -1617,6 +1625,7 @@ describe('ContributionResolver', () => {
|
|||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
})
|
})
|
||||||
|
expect(contributionListObject.contributionList).toHaveLength(4)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -2336,7 +2345,7 @@ describe('ContributionResolver', () => {
|
|||||||
await expect(EventProtocol.find()).resolves.toContainEqual(
|
await expect(EventProtocol.find()).resolves.toContainEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
type: EventProtocolType.ADMIN_CONTRIBUTION_UPDATE,
|
type: EventProtocolType.ADMIN_CONTRIBUTION_UPDATE,
|
||||||
userId: admin.id,
|
userId: bibi.id,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -2376,7 +2385,7 @@ describe('ContributionResolver', () => {
|
|||||||
await expect(EventProtocol.find()).resolves.toContainEqual(
|
await expect(EventProtocol.find()).resolves.toContainEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
type: EventProtocolType.ADMIN_CONTRIBUTION_UPDATE,
|
type: EventProtocolType.ADMIN_CONTRIBUTION_UPDATE,
|
||||||
userId: admin.id,
|
userId: bibi.id,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
@ -2554,7 +2563,7 @@ describe('ContributionResolver', () => {
|
|||||||
await expect(EventProtocol.find()).resolves.toContainEqual(
|
await expect(EventProtocol.find()).resolves.toContainEqual(
|
||||||
expect.objectContaining({
|
expect.objectContaining({
|
||||||
type: EventProtocolType.ADMIN_CONTRIBUTION_DELETE,
|
type: EventProtocolType.ADMIN_CONTRIBUTION_DELETE,
|
||||||
userId: admin.id,
|
userId: bibi.id,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|||||||
@ -166,6 +166,15 @@ export const listContributions = gql`
|
|||||||
id
|
id
|
||||||
amount
|
amount
|
||||||
memo
|
memo
|
||||||
|
createdAt
|
||||||
|
contributionDate
|
||||||
|
confirmedAt
|
||||||
|
confirmedBy
|
||||||
|
deletedAt
|
||||||
|
state
|
||||||
|
messagesCount
|
||||||
|
deniedAt
|
||||||
|
deniedBy
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user