import { describe, it, expect } from 'vitest'; import { convertChannelToRoundCard } from '../convert-channel-to-round-card'; describe('convertChannelToRoundCard', () => { it('конвертирует канал в round card', () => { const channel = { guid: 'ch-1', name: 'Channel Name', url: '/channels/1', videosCount: 50, isNetwork: false, updated: 0, avatarUrl: 'https://img.com/avatar.jpg', description: '', }; const result = convertChannelToRoundCard(channel); expect(result.title).toBe('Channel Name'); expect(result.primaryImageUrl).toBe('https://img.com/avatar.jpg'); expect(result.videosCount).toBe(50); expect(result.link).toBe('/channels/channel-name'); }); it('slug с заглавными', () => { const channel = { guid: 'ch-2', name: 'Big Studio', url: '', videosCount: 0, isNetwork: false, updated: 0, avatarUrl: '', description: '', }; const result = convertChannelToRoundCard(channel); expect(result.link).toBe('/channels/big-studio'); }); });