import { describe, it, expect } from 'vitest' import { buildTargetPath, withCollisionSuffix } from '../src/main/pathBuilder' import type { CaptureDate } from '../src/shared/types' const date: CaptureDate = { year: '2024', month: '03', source: 'exif' } describe('buildTargetPath', () => { it('인물 매칭 시 /프로필/YYYY/MM/파일명 경로를 만든다', () => { const p = buildTargetPath('/out', 'seunghyun', date, '/src/a/photo.jpg') expect(p.replace(/\\/g, '/')).toBe('/out/seunghyun/2024/03/photo.jpg') }) it('미검출(who=null) 시 [미정] 폴더로 보낸다', () => { const p = buildTargetPath('/out', null, date, '/src/photo.png') expect(p.replace(/\\/g, '/')).toBe('/out/[미정]/2024/03/photo.png') }) }) describe('withCollisionSuffix', () => { it('확장자 앞에 _N을 붙인다', () => { const p = withCollisionSuffix('/out/x/photo.jpg', 2) expect(p.replace(/\\/g, '/')).toBe('/out/x/photo_2.jpg') }) })