d3ro-voice/apps/desktop/tests/unit/meeting-imported-recording.test.ts

31 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { buildImportedMeetingTranscript } from '../../src/main/services/meeting/imported-recording'
describe('가져온 녹음의 회의 전사 변환', () => {
it('파일 이름을 회의 제목으로 쓰고 STT 구간을 상대 시각 전사로 바꾼다', () => {
expect(buildImportedMeetingTranscript({
fileName: '주간 제품 회의.mp4',
fullText: '첫 발언 두 번째 발언',
totalDurationSec: 65.4,
segments: [
{ text: ' 첫 발언 ', start: 1.25, end: 4, confidence: 0.9 },
{ text: '두 번째 발언', start: 61, end: 65, confidence: 0.8 },
],
})).toEqual({
title: '주간 제품 회의',
rawTranscript: '[00:01] 첫 발언\n[01:01] 두 번째 발언',
durationMs: 65_400,
})
})
it('구간 정보가 없으면 원문을 보존한다', () => {
const result = buildImportedMeetingTranscript({
fileName: 'memo.wav',
fullText: ' 전사 원문 ',
totalDurationSec: 3,
segments: [],
})
expect(result.rawTranscript).toBe('전사 원문')
expect(result.durationMs).toBe(3_000)
})
})