import { describe, it, expect } from 'vitest'; import { convertStringArrayToChips } from '../convert-string-array-to-chips'; describe('convertStringArrayToChips', () => { it('конвертирует массив строк в чипсы', () => { const result = convertStringArrayToChips(['teen', 'milf'], 'tags', '/videos'); expect(result).toEqual([ { title: 'teen', value: 'teen', prefix: 'tags', resetPath: '/videos' }, { title: 'milf', value: 'milf', prefix: 'tags', resetPath: '/videos' }, ]); }); it('# → post', () => { const result = convertStringArrayToChips(['#', 'teen'], 'tags', '/'); expect(result[0]).toEqual({ title: 'post', value: 'post', prefix: 'tags', resetPath: '/' }); }); it('пустой массив', () => { expect(convertStringArrayToChips([], 'tags', '/')).toEqual([]); }); });