mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Electron-385 (Remove third party dependency and write custom implementation) (#350)
- Remove third party dependency and write custom implementation - Add negative test case
This commit is contained in:
committed by
Vishwas Shashidhar
parent
c1e4016e93
commit
59a80f558c
@@ -32,6 +32,13 @@ describe('validate url with whitelist', function() {
|
||||
return expect(checkWhitelist(url, whitelist)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should return true for non-standard TLDs', function() {
|
||||
const whitelist = 'symphony.com, symphony.econet';
|
||||
const url = 'https://my.symphony.econet/';
|
||||
|
||||
return expect(checkWhitelist(url, whitelist)).toBeTruthy();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('checkWhitelist falsity tests', function () {
|
||||
@@ -50,6 +57,13 @@ describe('validate url with whitelist', function() {
|
||||
return expect(checkWhitelist(url, whitelist)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should return false when TLD does not match', function () {
|
||||
const whitelist = 'www.symphony.com, app.symphony.com, my.symphony.com';
|
||||
const url = 'https://my.symphony.echonet/';
|
||||
|
||||
return expect(checkWhitelist(url, whitelist)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should return false when the URL is invalid', function () {
|
||||
const whitelist = 'www.symphony.com, app.symphony.com, my.symphony.com';
|
||||
const url = 'invalidUrl';
|
||||
|
||||
Reference in New Issue
Block a user