89 lines
1.8 KiB
JSON
89 lines
1.8 KiB
JSON
[
|
|
{
|
|
"description": "maxLength validation",
|
|
"database": {
|
|
"schemas": {
|
|
"maxLength_0_0": {
|
|
"maxLength": 2
|
|
}
|
|
}
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "shorter is valid",
|
|
"data": "f",
|
|
"schema_id": "maxLength_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
},
|
|
{
|
|
"description": "exact length is valid",
|
|
"data": "fo",
|
|
"schema_id": "maxLength_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
},
|
|
{
|
|
"description": "too long is invalid",
|
|
"data": "foo",
|
|
"schema_id": "maxLength_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": false
|
|
}
|
|
},
|
|
{
|
|
"description": "ignores non-strings",
|
|
"data": 100,
|
|
"schema_id": "maxLength_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
},
|
|
{
|
|
"description": "two graphemes is long enough",
|
|
"data": "💩💩",
|
|
"schema_id": "maxLength_0_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"description": "maxLength validation with a decimal",
|
|
"database": {
|
|
"schemas": {
|
|
"maxLength_1_0": {
|
|
"maxLength": 2
|
|
}
|
|
}
|
|
},
|
|
"tests": [
|
|
{
|
|
"description": "shorter is valid",
|
|
"data": "f",
|
|
"schema_id": "maxLength_1_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": true
|
|
}
|
|
},
|
|
{
|
|
"description": "too long is invalid",
|
|
"data": "foo",
|
|
"schema_id": "maxLength_1_0",
|
|
"action": "validate",
|
|
"expect": {
|
|
"success": false
|
|
}
|
|
}
|
|
]
|
|
}
|
|
] |