mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into Contribution-Messages
This commit is contained in:
commit
43be07ac1b
@ -69,8 +69,7 @@ describe('ContributionMessageResolver', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(() => {
|
||||||
await cleanDB()
|
|
||||||
resetToken()
|
resetToken()
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -142,24 +141,13 @@ describe('ContributionMessageResolver', () => {
|
|||||||
|
|
||||||
describe('authenticated', () => {
|
describe('authenticated', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await userFactory(testEnv, bibiBloxberg)
|
|
||||||
await userFactory(testEnv, peterLustig)
|
|
||||||
await query({
|
await query({
|
||||||
query: login,
|
query: login,
|
||||||
variables: { email: 'bibi@bloxberg.de', password: 'Aa12345_' },
|
variables: { email: 'bibi@bloxberg.de', password: 'Aa12345_' },
|
||||||
})
|
})
|
||||||
result = await mutate({
|
|
||||||
mutation: createContribution,
|
|
||||||
variables: {
|
|
||||||
amount: 100.0,
|
|
||||||
memo: 'Test env contribution',
|
|
||||||
creationDate: new Date().toString(),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(() => {
|
||||||
await cleanDB()
|
|
||||||
resetToken()
|
resetToken()
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -217,18 +205,13 @@ describe('ContributionMessageResolver', () => {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
afterAll(async () => {
|
|
||||||
await cleanDB()
|
|
||||||
resetToken()
|
|
||||||
})
|
|
||||||
|
|
||||||
it('creates ContributionMessage', async () => {
|
it('creates ContributionMessage', async () => {
|
||||||
await expect(
|
await expect(
|
||||||
mutate({
|
mutate({
|
||||||
mutation: createContributionMessage,
|
mutation: createContributionMessage,
|
||||||
variables: {
|
variables: {
|
||||||
contributionId: result.data.createContribution.id,
|
contributionId: result.data.createContribution.id,
|
||||||
message: 'Test',
|
message: 'User Test',
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
).resolves.toEqual(
|
).resolves.toEqual(
|
||||||
@ -236,7 +219,7 @@ describe('ContributionMessageResolver', () => {
|
|||||||
data: {
|
data: {
|
||||||
createContributionMessage: expect.objectContaining({
|
createContributionMessage: expect.objectContaining({
|
||||||
id: expect.any(Number),
|
id: expect.any(Number),
|
||||||
message: 'Test',
|
message: 'User Test',
|
||||||
type: 'DIALOG',
|
type: 'DIALOG',
|
||||||
userFirstName: 'Bibi',
|
userFirstName: 'Bibi',
|
||||||
userLastName: 'Bloxberg',
|
userLastName: 'Bloxberg',
|
||||||
@ -267,46 +250,13 @@ describe('ContributionMessageResolver', () => {
|
|||||||
|
|
||||||
describe('authenticated', () => {
|
describe('authenticated', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await userFactory(testEnv, bibiBloxberg)
|
|
||||||
await userFactory(testEnv, peterLustig)
|
|
||||||
await query({
|
await query({
|
||||||
query: login,
|
query: login,
|
||||||
variables: { email: 'bibi@bloxberg.de', password: 'Aa12345_' },
|
variables: { email: 'bibi@bloxberg.de', password: 'Aa12345_' },
|
||||||
})
|
})
|
||||||
result = await mutate({
|
|
||||||
mutation: createContribution,
|
|
||||||
variables: {
|
|
||||||
amount: 100.0,
|
|
||||||
memo: 'Test env contribution',
|
|
||||||
creationDate: new Date().toString(),
|
|
||||||
},
|
|
||||||
})
|
|
||||||
await query({
|
|
||||||
query: login,
|
|
||||||
variables: { email: 'peter@lustig.de', password: 'Aa12345_' },
|
|
||||||
})
|
|
||||||
await mutate({
|
|
||||||
mutation: adminCreateContributionMessage,
|
|
||||||
variables: {
|
|
||||||
contributionId: result.data.createContribution.id,
|
|
||||||
message: 'Admin Test',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
await query({
|
|
||||||
query: login,
|
|
||||||
variables: { email: 'bibi@bloxberg.de', password: 'Aa12345_' },
|
|
||||||
})
|
|
||||||
await mutate({
|
|
||||||
mutation: createContributionMessage,
|
|
||||||
variables: {
|
|
||||||
contributionId: result.data.createContribution.id,
|
|
||||||
message: 'User Test',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(() => {
|
||||||
await cleanDB()
|
|
||||||
resetToken()
|
resetToken()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user