keystonejs/keystone-classic

TextType - Over-length value validates when both max and min specified

Open

#4,536 创建于 2017年12月28日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)JavaScript (2,288 fork)batch import
4.x candidatebughelp wanted

仓库指标

Star
 (14,656 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Expected behavior

When both max and min are specified in a field definition, over length strings should be refused.

Actual/Current behavior

Over length string accepted

Steps to reproduce the actual/current behavior

Define a field as per below: name: { type: Types.Text, required: true, min: 3, max: 5 }, Enter a string longer than 5 characters Submit

Environment

Keystone master (0ca9eb18c00fb051c579105ae7d283f98b182d8d) Node v9.2.0

Notes

Issue seems to be caused by a922b38a12bad632ef6f5d992ea91b363bb78d4f. If min length validation passes, all other validation results are discarded.

贡献者指南