mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
apply suggestions
This commit is contained in:
parent
16739e7e4d
commit
8f6d2b5f3c
@ -148,6 +148,63 @@ describe('TransactionLinkResolver', () => {
|
||||
])
|
||||
})
|
||||
|
||||
it('throws error when memo text is too short', async () => {
|
||||
jest.clearAllMocks()
|
||||
const { errors: errorObjects } = await mutate({
|
||||
mutation: createTransactionLink,
|
||||
variables: {
|
||||
amount: 100,
|
||||
memo: 'Test',
|
||||
},
|
||||
})
|
||||
expect(errorObjects).toMatchObject([
|
||||
{
|
||||
message: 'Argument Validation Error',
|
||||
extensions: {
|
||||
exception: {
|
||||
validationErrors: [
|
||||
{
|
||||
property: 'memo',
|
||||
constraints: {
|
||||
minLength: 'memo must be longer than or equal to 5 characters',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
it('throws error when memo text is too long', async () => {
|
||||
jest.clearAllMocks()
|
||||
const { errors: errorObjects } = await mutate({
|
||||
mutation: createTransactionLink,
|
||||
variables: {
|
||||
identifier: 'peter@lustig.de',
|
||||
amount: 100,
|
||||
memo: 'test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test t',
|
||||
},
|
||||
})
|
||||
expect(errorObjects).toMatchObject([
|
||||
{
|
||||
message: 'Argument Validation Error',
|
||||
extensions: {
|
||||
exception: {
|
||||
validationErrors: [
|
||||
{
|
||||
property: 'memo',
|
||||
constraints: {
|
||||
maxLength: 'memo must be shorter than or equal to 255 characters',
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
])
|
||||
})
|
||||
|
||||
it('throws error when user has not enough GDD', async () => {
|
||||
jest.clearAllMocks()
|
||||
await expect(
|
||||
|
||||
@ -14,11 +14,11 @@ export const schema = async (): Promise<GraphQLSchema> => {
|
||||
scalarsMap: [{ type: Decimal, scalar: DecimalScalar }],
|
||||
validate: {
|
||||
validationError: { target: false },
|
||||
skipMissingProperties: true,
|
||||
skipMissingProperties: false,
|
||||
skipNullProperties: true,
|
||||
skipUndefinedProperties: true,
|
||||
forbidUnknownValues: false,
|
||||
stopAtFirstError: false,
|
||||
skipUndefinedProperties: false,
|
||||
forbidUnknownValues: true,
|
||||
stopAtFirstError: true,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user