From 0ece2d099bd0216778f86e482d57ce4650f677f5 Mon Sep 17 00:00:00 2001 From: Mudduwe Jayasekara Date: Tue, 26 Mar 2024 21:25:55 -0700 Subject: [PATCH] Add code to avoid ',' character on email id --- test/validators.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/validators.test.js b/test/validators.test.js index 6c68cd71a..2f16df27e 100644 --- a/test/validators.test.js +++ b/test/validators.test.js @@ -14514,4 +14514,20 @@ describe('Validators', () => { ], }); }); + it('should reject email addresses with special characters', () => { + test({ + validator: 'isEmail', + valid: [ + 'valid.email@example.com', + 'another_valid.email@example.co.uk', + 'user12345@example.com', + 'firstname.lastname@example.com', + 'email-with-hyphens@example.com', + ], + invalid: [ + 'te¸st@test.com', // Special character "¸" + ], + }); + }); + });