feat(w3): ship v1.4.0 export matrix, cockpit tasks, and focus ambient
Add ExportMatrixService for txt/md/docx/pdf, extend ExportModal, cockpit outline tasks, focus ambient sound, and E2E-PDF-01 with 134 passing unit tests. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { buildTxtExport, htmlToPlainParagraphs } from '../../src/main/lib/export-content'
|
||||
|
||||
describe('export-content', () => {
|
||||
it('htmlToPlainParagraphs splits paragraph tags', () => {
|
||||
const html = '<p>第一段。</p><p>第二段。</p>'
|
||||
expect(htmlToPlainParagraphs(html)).toEqual(['第一段。', '第二段。'])
|
||||
})
|
||||
|
||||
it('buildTxtExport includes chapter title and AI marker', () => {
|
||||
const txt = buildTxtExport([
|
||||
{
|
||||
id: '1',
|
||||
title: '第一章',
|
||||
volumeName: '卷一',
|
||||
paragraphs: ['正文内容。'],
|
||||
annotations: [],
|
||||
hasAiContent: true
|
||||
}
|
||||
])
|
||||
expect(txt).toContain('# 第一章')
|
||||
expect(txt).toContain('[AI生成内容]')
|
||||
expect(txt).toContain('正文内容。')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user