/** * Tests for URL parser/orchestrator */ import { isParseableURL, getPlatformType } from './url'; describe('URL Parser', () => { describe('isParseableURL', () => { it('should identify parseable Instagram URLs', () => { expect(isParseableURL('https://instagram.com/p/Abc123')).toBe(true); }); it('should identify parseable Twitter URLs', () => { expect(isParseableURL('https://twitter.com/user/status/123')).toBe(true); }); it('should identify parseable web URLs', () => { expect(isParseableURL('https://example.com/article')).toBe(true); }); it('should reject invalid URLs', () => { expect(isParseableURL('not a url')).toBe(false); }); }); describe('getPlatformType', () => { it('should detect Instagram platform', () => { expect(getPlatformType('https://instagram.com/p/Abc123')).toBe('instagram'); }); it('should detect Twitter platform', () => { expect(getPlatformType('https://twitter.com/user/status/123')).toBe('twitter'); }); it('should detect web platform', () => { expect(getPlatformType('https://example.com')).toBe('web'); }); it('should return unknown for invalid URLs', () => { expect(getPlatformType('not a url')).toBe('unknown'); }); }); });