Files
pipu-music/packages/core/src/social.test.ts
T
mrleo1nid 0a05bfe2cd
ci / module boundaries / boundaries (push) Successful in 7s
ci / api / api (push) Successful in 1m9s
ci / mobile / mobile (Metro-бандл Android) (push) Successful in 1m8s
ci / contract / contract (сгенерированный код совпадает с openapi.yaml) (push) Successful in 1m23s
ci / db / db (push) Successful in 2m29s
ci / ts / ts (packages + web) (push) Successful in 2m55s
feat(social): add friends, private chats, inbox and music sharing
2026-10-23 03:19:29 +03:00

12 lines
593 B
TypeScript

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();
});
});