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
12 lines
593 B
TypeScript
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();
|
|
});
|
|
});
|