-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: reject dangerous email payloads
Fixes #228
- Loading branch information
Showing
2 changed files
with
15 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 |
---|---|---|
|
@@ -21,4 +21,16 @@ describe('<ValidatorMediaInfo />', () => { | |
const el = screen.queryByRole('link') | ||
expect(el).toBeNull() | ||
}) | ||
|
||
it('should display an email if the address is valid', () => { | ||
render(<ValidatorMediaInfo mediaInfo={{ email_address: '[email protected]' }} />) | ||
const el = screen.getByRole('link') | ||
expect(el).toHaveAttribute('href', 'mailto:[email protected]') | ||
}) | ||
|
||
it('should not display the email if the address is dangerous', () => { | ||
render(<ValidatorMediaInfo mediaInfo={{ email_address: '[email protected]?attach=dangerouspayload' }} />) | ||
const el = screen.queryByRole('link') | ||
expect(el).toBeNull() | ||
}) | ||
}) |
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