返回 oh-my-ppt
extraction-report.test.ts
根目录 / tests / unit / html-pptx / extraction-report.test.ts
1 import { describe, expect, it } from 'vitest'
2 import { buildExtractionReportWarning } from '../../../src/main/io/html-pptx/extraction-report'
3
4 describe('PPTX extraction report warning', () => {
5 it('reports editable-export fallbacks without claiming that content was dropped', () => {
6 expect(
7 buildExtractionReportWarning('page-1', {
8 textLimitReached: true,
9 shapeLimitReached: false,
10 imageLimitReached: true,
11 unsupportedTransformCount: 2,
12 imageRasterFallbackCount: 1
13 })
14 ).toBe(
15 '页面 page-1:可编辑文本达到上限,剩余文本已保留在背景图;可编辑图片达到上限,剩余图片已保留在背景图;2 个复杂变换元素已保留在背景图;1 个图片或图表无法安全转换,已保留在背景图'
16 )
17 })
18
19 it('omits the warning when extraction has no fallback report', () => {
20 expect(buildExtractionReportWarning('page-1', undefined)).toBeUndefined()
21 })
22 })
23
23 lines TYPESCRIPT