Files
genoffice/apps/docs/tests/anchor-line-spec.test.ts
T
merrick-2002andGenOffice 69b4ce0560 Sync snapshot (2026-09-06) (#243)
- Docs: Word-style dark page, phased fast open for long documents, fonts embedded in the DOCX, spellcheck toggle, hyperlink editing, and ~80 Word fidelity fixes (CJK/JP metrics, header/footer, tables, anchored pictures)
- Sheets: hold formula recalculation while file data streams in, large-workbook scroll/load performance, combo charts, duplicate/unique conditional formatting by display text, RTL frozen-pane fix, workbooks whose ZIP entries carry a leading slash
- Slides: MTX-compressed embedded font support, CJK/Latin face selection and PowerPoint script fallbacks, theme colors kept on paragraph defaults and bullets, more reliable AI edits with a layout audit after each batch
- PDF: AI page ops, text block move/align, notes and markup editing, watermark and header/footer, form check boxes, metadata; the cloud Export as Word fallback is removed, conversion is always on-device
- AI: Gemini tool schema translation, OpenCode Zen/Go providers, markdown tables and code blocks in chat, current date in the system prompt
- Shell: Office-style ribbon collapse across all editors, native Windows ARM64 installer, BUILD_DIR override for packaging

Co-authored-by: GenOffice <merrick-2002@users.noreply.github.com>
2026-09-07 00:18:14 +08:00

20 lines
745 B
TypeScript

import { describe, expect, it } from 'vitest'
import { anchorLineSpec } from '../src/renderer/editor/extensions'
describe('anchorLineSpec', () => {
it('lays the line out with the paragraph format but leaves the page break on the picture', () => {
const [tag, attrs] = anchorLineSpec({
pageBreakBefore: true,
keepNext: true,
spaceBefore: 240,
styleId: 'Caption',
}) as [string, Record<string, string>, unknown]
expect(tag).toBe('p')
expect(attrs.class).toContain('doc-anchor-line')
expect(attrs.class).not.toContain('page-break-before')
expect(attrs['data-page-break-label']).toBeUndefined()
expect(attrs['data-para']).toBeUndefined()
expect(attrs.style).toContain('margin-top')
})
})