mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge pull request #2639 from gradido/refactor-deny-contribution-unit-test
refactor(backend): unit test for the method denyContribution
This commit is contained in:
commit
8611c53bc6
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@ export const nMonthsBefore = (date: Date, months = 1): string => {
|
|||||||
export const creationFactory = async (
|
export const creationFactory = async (
|
||||||
client: ApolloServerTestClient,
|
client: ApolloServerTestClient,
|
||||||
creation: CreationInterface,
|
creation: CreationInterface,
|
||||||
): Promise<Contribution | void> => {
|
): Promise<Contribution> => {
|
||||||
const { mutate } = client
|
const { mutate } = client
|
||||||
await mutate({ mutation: login, variables: { email: creation.email, password: 'Aa12345_' } })
|
await mutate({ mutation: login, variables: { email: creation.email, password: 'Aa12345_' } })
|
||||||
|
|
||||||
@ -51,6 +51,7 @@ export const creationFactory = async (
|
|||||||
await confirmedContribution.save()
|
await confirmedContribution.save()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return confirmedContribution
|
||||||
} else {
|
} else {
|
||||||
return contribution
|
return contribution
|
||||||
}
|
}
|
||||||
|
|||||||
@ -272,6 +272,12 @@ export const deleteContribution = gql`
|
|||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
export const denyContribution = gql`
|
||||||
|
mutation ($id: Int!) {
|
||||||
|
denyContribution(id: $id)
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|
||||||
export const createContributionMessage = gql`
|
export const createContributionMessage = gql`
|
||||||
mutation ($contributionId: Float!, $message: String!) {
|
mutation ($contributionId: Float!, $message: String!) {
|
||||||
createContributionMessage(contributionId: $contributionId, message: $message) {
|
createContributionMessage(contributionId: $contributionId, message: $message) {
|
||||||
|
|||||||
@ -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