feat: ship v1.1.0 writer toolkit with templates, import, export, and inspiration capture
Implement chapter templates, txt/md/docx import, submission export presets, and global inspiration shortcut. Split import handlers into a separate main bundle and fix EditorLayout setTarget loop that broke E2E. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { formatChapterForSubmission } from '../../src/main/lib/submission-formatter'
|
||||
import { BUILTIN_SUBMISSION_PRESETS } from '../../src/shared/builtin-templates'
|
||||
|
||||
const preset = BUILTIN_SUBMISSION_PRESETS[0]!
|
||||
|
||||
describe('submission-formatter', () => {
|
||||
it('UT-EXPORT-01: indentParagraphs adds fullwidth spaces', () => {
|
||||
const text = formatChapterForSubmission({
|
||||
chapterNumber: 1,
|
||||
chapterTitle: '测试',
|
||||
contentHtml: '<p>第一段</p><p>第二段</p>',
|
||||
preset
|
||||
})
|
||||
expect(text).toContain(' 第一段')
|
||||
expect(text).toContain(' 第二段')
|
||||
})
|
||||
|
||||
it('UT-EXPORT-02: title format', () => {
|
||||
const text = formatChapterForSubmission({
|
||||
chapterNumber: 1,
|
||||
chapterTitle: '觉醒',
|
||||
contentHtml: '<p>正文</p>',
|
||||
preset
|
||||
})
|
||||
expect(text.startsWith('# 第1章 觉醒')).toBe(true)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user