返回 oh-my-ppt
html-utils-preview-only-boundary.test.ts
根目录 / tests / unit / tools / html-utils-preview-only-boundary.test.ts
1 import { describe, expect, it } from 'vitest'
2
3 import { validateHtmlContent } from '../../../src/main/presentation/html/html-utils'
4
5 describe('validateHtmlContent preview-only animation boundary', () => {
6 it('rejects anime SVG motion-path helpers in normal editable content', () => {
7 const result = validateHtmlContent(`
8 <div class="card">Card</div>
9 <script>
10 anime.svg.createMotionPath("#curve")
11 </script>
12 `)
13
14 expect(result.errors.join('\n')).toContain('preview-only 方向')
15 })
16
17 it('rejects splitText-style fragmented text animation in normal editable content', () => {
18 const result = validateHtmlContent(`
19 <div class="title">Title</div>
20 <script>
21 splitText(".title")
22 </script>
23 `)
24
25 expect(result.errors.join('\n')).toContain('splitText 文本碎片动画')
26 })
27 })
28
28 lines TYPESCRIPT