import { describe, it, expect } from 'vitest'; import { cleanMiniCategoryCard } from '../clean-mini-category-card'; describe('cleanMiniCategoryCard', () => { it('полные данные', () => { const raw = { name: 'teen', title: 'Teen', is_top: true, videosCount: 50, icon: 'icon.svg', }; const result = cleanMiniCategoryCard(raw as any); expect(result).toEqual({ name: 'teen', title: 'Teen', isTop: true, videosCount: 50, icon: 'icon.svg', }); }); it('пустые данные → дефолты', () => { const result = cleanMiniCategoryCard({} as any); expect(result.name).toBe(''); expect(result.title).toBe(''); expect(result.isTop).toBe(false); expect(result.videosCount).toBe(0); expect(result.icon).toBeUndefined(); }); });