From cdd11e57bd1ca399d3e4f27704732d444f0aaf9d Mon Sep 17 00:00:00 2001 From: wellgenio Date: Sat, 24 Aug 2024 08:49:42 -0300 Subject: [PATCH] fix message error in tests --- lib/src/lucid_validation.dart | 2 +- test/lucid_validation_test.dart | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/src/lucid_validation.dart b/lib/src/lucid_validation.dart index 09cdbec..b8e0b39 100644 --- a/lib/src/lucid_validation.dart +++ b/lib/src/lucid_validation.dart @@ -13,7 +13,7 @@ class _PropSelector { /// /// [E] represents the type of the entity being validated. abstract class LucidValidation { - final List<_PropSelector> _propSelectors = []; + final List<_PropSelector> _propSelectors = []; /// Registers a validation rule for a specific property of the entity. /// diff --git a/test/lucid_validation_test.dart b/test/lucid_validation_test.dart index 5b46412..e2c8ef8 100644 --- a/test/lucid_validation_test.dart +++ b/test/lucid_validation_test.dart @@ -16,8 +16,8 @@ void main() { expect(errors.length, 2); expect(errors.first.key, 'email'); - expect(errors.first.message, 'This field cannot be empty'); - expect(errors[1].message, 'E-mail in invalid format'); + expect(errors.first.message, 'Cannot be empty'); + expect(errors[1].message, 'Invalid email address'); }); test('when validating [UserModel] should return a list of error messages for the password field', () { @@ -33,12 +33,12 @@ void main() { expect(errors.length, 6); expect(errors.first.key, 'password'); - expect(errors.first.message, 'This field cannot be empty'); + expect(errors.first.message, 'Cannot be empty'); expect(errors[1].message, 'Must be at least 8 characters long'); - expect(errors[2].message, 'Must contain lowercase'); - expect(errors[3].message, 'Must contain uppercase'); - expect(errors[4].message, 'Must contain number'); - expect(errors[5].message, 'Must contain special character'); + expect(errors[2].message, 'Must contain at least one lowercase letter'); + expect(errors[3].message, 'Must contain at least one uppercase letter'); + expect(errors[4].message, 'Must contain at least one numeric digit'); + expect(errors[5].message, 'Must contain at least one special character'); }); test('when validating [UserModel] should return a list of error messages for the age field', () {