-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow multi email in contact field
- Loading branch information
Showing
2 changed files
with
23 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -102,4 +102,26 @@ describe('contact model', (): void => { | |
telephone: '+687241541' | ||
}); | ||
}); | ||
|
||
it('should allow multi email in courriel field separated by ;', (): void => { | ||
const contactData: ContactToValidate = { | ||
courriel: '[email protected];[email protected]' | ||
}; | ||
|
||
const contact: Contact = Contact(contactData); | ||
|
||
expect(contact).toStrictEqual({ | ||
courriel: '[email protected];[email protected]' | ||
}); | ||
}); | ||
|
||
it('should not validate one of multi courriel', (): void => { | ||
const contactData: ContactToValidate = { | ||
courriel: '[email protected];test2@mairie' | ||
}; | ||
|
||
expect((): void => { | ||
Contact(contactData); | ||
}).toThrow(new CourrielError('[email protected];test2@mairie')); | ||
}); | ||
}); |
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