The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/tests/unit/lib/utils/isURL.spec.ts

22 lines
613 B

import { expect } from 'chai';
import { isURL } from '../../../../lib/utils/isURL';
describe('isURL', () => {
const testCases = [
['/', false],
['test', false],
['test/test', false],
['.', false],
['./test', false],
['https://rocket.chat', true],
['data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==', true],
] as const;
testCases.forEach(([parameter, expectedResult]) => {
it(`should return ${JSON.stringify(expectedResult)} for ${JSON.stringify(parameter)}`, () => {
const result = isURL(parameter);
expect(result).to.be.equal(expectedResult);
});
});
});