-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow requiring display names as part of email, optionally
- Loading branch information
1 parent
4726231
commit 051ebd2
Showing
7 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,6 +151,53 @@ describe('Validators', function () { | |
}); | ||
}); | ||
|
||
it('should validate email addresses with required display names', function () { | ||
test({ | ||
validator: 'isEmail', | ||
args: [{ require_display_name: true }], | ||
valid: [ | ||
'Some Name <[email protected]>', | ||
'Some Name <[email protected]>', | ||
'Some Name <[email protected]>', | ||
'Some Name <[email protected]>', | ||
'Some Name <hans.m端[email protected]>', | ||
'Some Name <hans@m端ller.com>', | ||
'Some Name <test|123@m端ller.com>', | ||
'Some Name <[email protected]>', | ||
'Some Name <[email protected]>', | ||
'Some Middle Name <[email protected]>', | ||
'Name <[email protected]>', | ||
'Name<[email protected]>', | ||
], | ||
invalid: [ | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'[email protected]', | ||
'hans.m端[email protected]', | ||
'hans@m端ller.com', | ||
'test|123@m端ller.com', | ||
'[email protected]', | ||
'invalidemail@', | ||
'invalid.com', | ||
'@invalid.com', | ||
'[email protected].', | ||
'[email protected].', | ||
'Some Name <invalidemail@>', | ||
'Some Name <invalid.com>', | ||
'Some Name <@invalid.com>', | ||
'Some Name <[email protected].>', | ||
'Some Name <[email protected].>', | ||
'Some Name [email protected].>', | ||
'Some Name <[email protected].', | ||
'Some Name < [email protected] >', | ||
'Name [email protected]', | ||
], | ||
}); | ||
}); | ||
|
||
|
||
it('should validate URLs', function () { | ||
test({ | ||
validator: 'isURL', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.