fix: Render valid urls only in custom attributes (#3921)
This commit is contained in:
parent
047070ad87
commit
9f37a6e2ba
5 changed files with 23 additions and 21 deletions
|
@ -2,6 +2,7 @@ import {
|
|||
frontendURL,
|
||||
conversationUrl,
|
||||
accountIdFromPathname,
|
||||
isValidURL,
|
||||
} from '../URLHelper';
|
||||
|
||||
describe('#URL Helpers', () => {
|
||||
|
@ -48,4 +49,13 @@ describe('#URL Helpers', () => {
|
|||
expect(accountIdFromPathname('')).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('isValidURL', () => {
|
||||
it('should return true if valid url is passed', () => {
|
||||
expect(isValidURL('https://chatwoot.com')).toBe(true);
|
||||
});
|
||||
it('should return false if invalid url is passed', () => {
|
||||
expect(isValidURL('alert.window')).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue