mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add tests for semaphore
This commit is contained in:
parent
c59a5a3d30
commit
1b31d09278
@ -368,5 +368,74 @@ describe('send coins', () => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('more transactions to test semaphore', () => {
|
||||||
|
it('sends the coins four times in a row', async () => {
|
||||||
|
await expect(
|
||||||
|
mutate({
|
||||||
|
mutation: sendCoins,
|
||||||
|
variables: {
|
||||||
|
email: 'peter@lustig.de',
|
||||||
|
amount: 50,
|
||||||
|
memo: 'first transaction',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
).resolves.toEqual(
|
||||||
|
expect.objectContaining({
|
||||||
|
data: {
|
||||||
|
sendCoins: 'true',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
await expect(
|
||||||
|
mutate({
|
||||||
|
mutation: sendCoins,
|
||||||
|
variables: {
|
||||||
|
email: 'peter@lustig.de',
|
||||||
|
amount: 50,
|
||||||
|
memo: 'second transaction',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
).resolves.toEqual(
|
||||||
|
expect.objectContaining({
|
||||||
|
data: {
|
||||||
|
sendCoins: 'true',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
await expect(
|
||||||
|
mutate({
|
||||||
|
mutation: sendCoins,
|
||||||
|
variables: {
|
||||||
|
email: 'peter@lustig.de',
|
||||||
|
amount: 50,
|
||||||
|
memo: 'third transaction',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
).resolves.toEqual(
|
||||||
|
expect.objectContaining({
|
||||||
|
data: {
|
||||||
|
sendCoins: 'true',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
await expect(
|
||||||
|
mutate({
|
||||||
|
mutation: sendCoins,
|
||||||
|
variables: {
|
||||||
|
email: 'peter@lustig.de',
|
||||||
|
amount: 50,
|
||||||
|
memo: 'fourth transaction',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
).resolves.toEqual(
|
||||||
|
expect.objectContaining({
|
||||||
|
data: {
|
||||||
|
sendCoins: 'true',
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user