martmull
2024-11-22 12:06:31 +01:00
committed by GitHub
parent aa8b0ff04a
commit 76be1df66a
7 changed files with 25 additions and 118 deletions

View File

@ -5,10 +5,17 @@ describe('checkUrlType', () => {
expect(checkUrlType('https://www.linkedin.com/in/håkan-fisk')).toBe(
'linkedin',
);
expect(checkUrlType('http://www.linkedin.com/in/håkan-fisk')).toBe(
'linkedin',
);
expect(checkUrlType('https://linkedin.com/in/håkan-fisk')).toBe('linkedin');
expect(checkUrlType('http://linkedin.com/in/håkan-fisk')).toBe('linkedin');
expect(checkUrlType('linkedin.com/in/håkan-fisk')).toBe('linkedin');
});
it('should return "twitter", if twitter url', () => {
expect(checkUrlType('https://www.twitter.com/john-doe')).toBe('twitter');
expect(checkUrlType('https://www.x.com/john-doe')).toBe('twitter');
});
it('should return "url", if neither linkedin nor twitter url', () => {