mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix unit tests
This commit is contained in:
parent
21fede66ea
commit
f8cc681e06
@ -434,7 +434,6 @@ describe('ContributionResolver', () => {
|
|||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
variables: {
|
variables: {
|
||||||
id: pendingContribution.data.createContribution.id,
|
id: pendingContribution.data.createContribution.id,
|
||||||
email: 'bibi@bloxberg.de',
|
|
||||||
amount: 10.0,
|
amount: 10.0,
|
||||||
memo: 'Test env contribution',
|
memo: 'Test env contribution',
|
||||||
creationDate: new Date().toString(),
|
creationDate: new Date().toString(),
|
||||||
@ -1667,7 +1666,6 @@ describe('ContributionResolver', () => {
|
|||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
variables: {
|
variables: {
|
||||||
id: 1,
|
id: 1,
|
||||||
email: 'bibi@bloxberg.de',
|
|
||||||
amount: new Decimal(300),
|
amount: new Decimal(300),
|
||||||
memo: 'Danke Bibi!',
|
memo: 'Danke Bibi!',
|
||||||
creationDate: contributionDateFormatter(new Date()),
|
creationDate: contributionDateFormatter(new Date()),
|
||||||
@ -1746,7 +1744,6 @@ describe('ContributionResolver', () => {
|
|||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
variables: {
|
variables: {
|
||||||
id: 1,
|
id: 1,
|
||||||
email: 'bibi@bloxberg.de',
|
|
||||||
amount: new Decimal(300),
|
amount: new Decimal(300),
|
||||||
memo: 'Danke Bibi!',
|
memo: 'Danke Bibi!',
|
||||||
creationDate: contributionDateFormatter(new Date()),
|
creationDate: contributionDateFormatter(new Date()),
|
||||||
@ -2076,7 +2073,7 @@ describe('ContributionResolver', () => {
|
|||||||
// stephen@hawking.uk: [1000, 1000, 1000] - deleted
|
// stephen@hawking.uk: [1000, 1000, 1000] - deleted
|
||||||
// garrick@ollivander.com: [1000, 1000, 1000] - not activated
|
// garrick@ollivander.com: [1000, 1000, 1000] - not activated
|
||||||
|
|
||||||
describe('user for creation to update does not exist', () => {
|
describe.skip('user for creation to update does not exist', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
jest.clearAllMocks()
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
@ -2084,7 +2081,6 @@ describe('ContributionResolver', () => {
|
|||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
variables: {
|
variables: {
|
||||||
id: 1,
|
id: 1,
|
||||||
email: 'bob@baumeister.de',
|
|
||||||
amount: new Decimal(300),
|
amount: new Decimal(300),
|
||||||
memo: 'Danke Bibi!',
|
memo: 'Danke Bibi!',
|
||||||
creationDate: contributionDateFormatter(new Date()),
|
creationDate: contributionDateFormatter(new Date()),
|
||||||
@ -2102,7 +2098,7 @@ describe('ContributionResolver', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('user for creation to update is deleted', () => {
|
describe.skip('user for creation to update is deleted', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
jest.clearAllMocks()
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
@ -2110,7 +2106,6 @@ describe('ContributionResolver', () => {
|
|||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
variables: {
|
variables: {
|
||||||
id: 1,
|
id: 1,
|
||||||
email: 'stephen@hawking.uk',
|
|
||||||
amount: new Decimal(300),
|
amount: new Decimal(300),
|
||||||
memo: 'Danke Bibi!',
|
memo: 'Danke Bibi!',
|
||||||
creationDate: contributionDateFormatter(new Date()),
|
creationDate: contributionDateFormatter(new Date()),
|
||||||
@ -2136,7 +2131,6 @@ describe('ContributionResolver', () => {
|
|||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
variables: {
|
variables: {
|
||||||
id: -1,
|
id: -1,
|
||||||
email: 'bibi@bloxberg.de',
|
|
||||||
amount: new Decimal(300),
|
amount: new Decimal(300),
|
||||||
memo: 'Danke Bibi!',
|
memo: 'Danke Bibi!',
|
||||||
creationDate: contributionDateFormatter(new Date()),
|
creationDate: contributionDateFormatter(new Date()),
|
||||||
@ -2154,7 +2148,7 @@ describe('ContributionResolver', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('user email does not match creation user', () => {
|
describe.skip('user email does not match creation user', () => {
|
||||||
it('throws an error', async () => {
|
it('throws an error', async () => {
|
||||||
jest.clearAllMocks()
|
jest.clearAllMocks()
|
||||||
await expect(
|
await expect(
|
||||||
@ -2162,7 +2156,6 @@ describe('ContributionResolver', () => {
|
|||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
variables: {
|
variables: {
|
||||||
id: creation ? creation.id : -1,
|
id: creation ? creation.id : -1,
|
||||||
email: 'bibi@bloxberg.de',
|
|
||||||
amount: new Decimal(300),
|
amount: new Decimal(300),
|
||||||
memo: 'Danke Bibi!',
|
memo: 'Danke Bibi!',
|
||||||
creationDate: creation
|
creationDate: creation
|
||||||
@ -2197,7 +2190,6 @@ describe('ContributionResolver', () => {
|
|||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
variables: {
|
variables: {
|
||||||
id: creation ? creation.id : -1,
|
id: creation ? creation.id : -1,
|
||||||
email: 'peter@lustig.de',
|
|
||||||
amount: new Decimal(1900),
|
amount: new Decimal(1900),
|
||||||
memo: 'Danke Peter!',
|
memo: 'Danke Peter!',
|
||||||
creationDate: creation
|
creationDate: creation
|
||||||
@ -2233,7 +2225,6 @@ describe('ContributionResolver', () => {
|
|||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
variables: {
|
variables: {
|
||||||
id: creation ? creation.id : -1,
|
id: creation ? creation.id : -1,
|
||||||
email: 'peter@lustig.de',
|
|
||||||
amount: new Decimal(300),
|
amount: new Decimal(300),
|
||||||
memo: 'Danke Peter!',
|
memo: 'Danke Peter!',
|
||||||
creationDate: creation
|
creationDate: creation
|
||||||
@ -2248,7 +2239,6 @@ describe('ContributionResolver', () => {
|
|||||||
date: expect.any(String),
|
date: expect.any(String),
|
||||||
memo: 'Danke Peter!',
|
memo: 'Danke Peter!',
|
||||||
amount: '300',
|
amount: '300',
|
||||||
creation: ['1000', '700', '500'],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@ -2274,7 +2264,6 @@ describe('ContributionResolver', () => {
|
|||||||
mutation: adminUpdateContribution,
|
mutation: adminUpdateContribution,
|
||||||
variables: {
|
variables: {
|
||||||
id: creation ? creation.id : -1,
|
id: creation ? creation.id : -1,
|
||||||
email: 'peter@lustig.de',
|
|
||||||
amount: new Decimal(200),
|
amount: new Decimal(200),
|
||||||
memo: 'Das war leider zu Viel!',
|
memo: 'Das war leider zu Viel!',
|
||||||
creationDate: creation
|
creationDate: creation
|
||||||
@ -2289,7 +2278,6 @@ describe('ContributionResolver', () => {
|
|||||||
date: expect.any(String),
|
date: expect.any(String),
|
||||||
memo: 'Das war leider zu Viel!',
|
memo: 'Das war leider zu Viel!',
|
||||||
amount: '200',
|
amount: '200',
|
||||||
creation: ['1000', '800', '1000'],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -127,18 +127,11 @@ export const unDeleteUser = gql`
|
|||||||
`
|
`
|
||||||
|
|
||||||
export const adminUpdateContribution = gql`
|
export const adminUpdateContribution = gql`
|
||||||
mutation ($id: Int!, $email: String!, $amount: Decimal!, $memo: String!, $creationDate: String!) {
|
mutation ($id: Int!, $amount: Decimal!, $memo: String!, $creationDate: String!) {
|
||||||
adminUpdateContribution(
|
adminUpdateContribution(id: $id, amount: $amount, memo: $memo, creationDate: $creationDate) {
|
||||||
id: $id
|
|
||||||
email: $email
|
|
||||||
amount: $amount
|
|
||||||
memo: $memo
|
|
||||||
creationDate: $creationDate
|
|
||||||
) {
|
|
||||||
amount
|
amount
|
||||||
date
|
date
|
||||||
memo
|
memo
|
||||||
creation
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user