Open langovoi opened 8 years ago
I have the same issue.
const newUser = {
name: {
first: 'Foo',
last: 'Bar',
},
email: 'for@bar.biz',
password: 'foobar',
};
it('should reject a new user without name', function (done) {
const invalidUser = Object.assign({}, newUser);
delete invalidUser.name;
new User(invalidUser).validate((err) => {
assert.equal('Path `name` is required.', err.errors.name.message);
done();
});
});
I have field with type.Name as required in model, but it's able to add item without name in DB. Error is null here. For complete overview - the email validation isn't work too for me at this moment in unit tests.
Steps to reproduce the behavior
Name
keystone.List(listName).model().save()
Expected behavior
Get validation error
Actual behavior
Item successfully saved