| 1 | import { describe, expect, it } from 'vitest' |
| 2 | import { |
| 3 | MAX_KEY_POINTS_PER_SLIDE, |
| 4 | normalizeKeyPoints, |
| 5 | normalizeOutlineText |
| 6 | } from '../../../src/main/generation/outline-normalizer' |
| 7 | |
| 8 | describe('outline normalizer', () => { |
| 9 | it('preserves explicit one-slide topic lists beyond four items', () => { |
| 10 | const outline = normalizeOutlineText( |
| 11 | '一些名词、安全风险、AI 使用场景、用好AI的方法、个人场景分享、待办事项、设计方向' |
| 12 | ) |
| 13 | |
| 14 | expect(outline).toBe( |
| 15 | '一些名词;安全风险;AI 使用场景;用好AI的方法;个人场景分享;待办事项;设计方向' |
| 16 | ) |
| 17 | }) |
| 18 | |
| 19 | it('keeps up to ten key points for a dense single slide plan', () => { |
| 20 | const points = [ |
| 21 | '一些名词', |
| 22 | '安全风险', |
| 23 | 'AI 使用场景', |
| 24 | '用好AI的方法', |
| 25 | '个人场景分享', |
| 26 | '待办事项', |
| 27 | '设计方向', |
| 28 | '结尾互动', |
| 29 | '备用主题', |
| 30 | '案例延展', |
| 31 | '超出上限' |
| 32 | ] |
| 33 | |
| 34 | expect(normalizeKeyPoints(points)).toEqual(points.slice(0, MAX_KEY_POINTS_PER_SLIDE)) |
| 35 | }) |
| 36 | }) |
| 37 |