Skip to content

Commit

Permalink
Added tests for isEmail quotes case
Browse files Browse the repository at this point in the history
  • Loading branch information
alokdwivedi103 committed Oct 6, 2024
1 parent 7d7153d commit 1b3e01f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,23 @@ describe('Validators', () => {
});
});

it('should not validate email addresses with quotes in the local part', () => {
test({
validator: 'isEmail',
args: [{ blacklisted_chars: '"' }],
valid: [
'foo@bar.com',
'test@example.com',
],
invalid: [
'"foobar"@example.com',
'"foo"bar@example.com',
'foo"bar"@example.com',
'" foo m端ller "@example.com',
'"foo\\@bar"@example.com',
],
});
});

it('should validate really long emails if ignore_max_length is set', () => {
test({
Expand Down

0 comments on commit 1b3e01f

Please sign in to comment.