import { describe, expect, it } from 'vitest'; import { attachmentPath } from './social'; describe('music attachments', () => { it('creates only internal catalog links and escapes identifiers', () => { expect(attachmentPath({ attachment_kind: 'track', attachment_id: 'a/b?sig=secret' })).toBe('/track/a%2Fb%3Fsig%3Dsecret'); expect(attachmentPath({ attachment_kind: 'playlist', attachment_id: 'a/b' })).toBe('/shared/playlist/a%2Fb'); expect(attachmentPath({ attachment_kind: 'none' })).toBeNull(); expect(attachmentPath({ attachment_kind: 'track' })).toBeNull(); }); });