Merge pull request #2639 from gradido/refactor-deny-contribution-unit-test

refactor(backend): unit test for the method denyContribution
This commit is contained in:
Hannes Heine 2023-02-16 17:38:25 +01:00 committed by GitHub
commit 8611c53bc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1297 additions and 944 deletions

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@ export const nMonthsBefore = (date: Date, months = 1): string => {
export const creationFactory = async (
client: ApolloServerTestClient,
creation: CreationInterface,
): Promise<Contribution | void> => {
): Promise<Contribution> => {
const { mutate } = client
await mutate({ mutation: login, variables: { email: creation.email, password: 'Aa12345_' } })
@ -51,6 +51,7 @@ export const creationFactory = async (
await confirmedContribution.save()
}
}
return confirmedContribution
} else {
return contribution
}

View File

@ -272,6 +272,12 @@ export const deleteContribution = gql`
}
`
export const denyContribution = gql`
mutation ($id: Int!) {
denyContribution(id: $id)
}
`
export const createContributionMessage = gql`
mutation ($contributionId: Float!, $message: String!) {
createContributionMessage(contributionId: $contributionId, message: $message) {

View File

@ -166,6 +166,15 @@ export const listContributions = gql`
id
amount
memo
createdAt
contributionDate
confirmedAt
confirmedBy
deletedAt
state
messagesCount
deniedAt
deniedBy
}
}
}