32 lines
1.5 KiB
TypeScript
32 lines
1.5 KiB
TypeScript
// tests/red/meeting-summary-redteam-r1-3.test.ts
|
|
// 자막 세션 자동 요약이 자막 세션 id 로 히스토리를 찾아 항상 실패하던 버그의 회귀 테스트.
|
|
|
|
import { describe, it, expect, vi } from 'vitest'
|
|
import { useRedHarness, historyInput } from './harness'
|
|
|
|
useRedHarness()
|
|
|
|
import { getMeetingSummaryService } from '../../src/main/services/MeetingSummaryService'
|
|
import { getHistoryService } from '../../src/main/services/HistoryService'
|
|
|
|
describe('MeetingSummaryService.onCaptionSessionSaved', () => {
|
|
it('자막 세션 요약에 실린 historyId 로 히스토리 행을 찾아 요약한다', async () => {
|
|
const text = '오늘 회의에서는 다음 분기 출시 일정과 담당자를 정했습니다. '.repeat(3)
|
|
const entry = getHistoryService().create(historyInput({ originalText: text, mode: 'caption' }))
|
|
const service = getMeetingSummaryService()
|
|
const summarize = vi.spyOn(service, 'summarize').mockResolvedValue(
|
|
undefined as unknown as Awaited<ReturnType<typeof service.summarize>>,
|
|
)
|
|
|
|
await service.onCaptionSessionSaved({ sessionId: 'caption-session-uuid', historyId: entry.id })
|
|
|
|
expect(summarize).toHaveBeenCalledWith(entry.id)
|
|
})
|
|
|
|
it('저장되지 않은 세션(historyId 없음)은 조용히 건너뛴다', async () => {
|
|
const service = getMeetingSummaryService()
|
|
const summarize = vi.spyOn(service, 'summarize')
|
|
await service.onCaptionSessionSaved({ sessionId: 'caption-session-uuid', historyId: null })
|
|
expect(summarize).not.toHaveBeenCalled()
|
|
})
|
|
})
|