1import { hasUrlProtocolPrefix } from '../url'; 2 3describe(hasUrlProtocolPrefix, () => { 4 [ 5 '', 6 'hello', 7 'about?uri=https://localhost:8081', 8 'https%3A%2F%2Flocalhost%3A8081%3Fabout%3Dface', 9 ].forEach((href) => { 10 it(`should return false for "${href}"`, () => { 11 expect(hasUrlProtocolPrefix(href)).toBe(false); 12 }); 13 }); 14 [ 15 'http://', 16 'https://', 17 'mailto://', 18 'tel://', 19 'sms://', 20 'exp+com.my-app_thing://', 21 'hello://world.com', 22 ].forEach((href) => { 23 it(`should return true for "${href}"`, () => { 24 expect(hasUrlProtocolPrefix(href)).toBe(true); 25 }); 26 }); 27}); 28