office-rendering-regression.spec.ts 1.2 KB

1234567891011121314151617181920212223242526
  1. import { readFileSync } from 'node:fs'
  2. import { join } from 'node:path'
  3. import { describe, expect, it } from 'vitest'
  4. const readSource = (relativePath: string) => {
  5. return readFileSync(join(process.cwd(), relativePath), 'utf8')
  6. }
  7. describe('office rendering regressions', () => {
  8. it('keeps DOCX fidelity-first paths as explicit opt-in features', () => {
  9. const source = readSource('packages/core/src/renderers/wordDocx.ts')
  10. expect(source).toContain("context?.options?.docx?.worker === true")
  11. expect(source).toContain("context?.options?.docx?.progressive === true")
  12. expect(source).toContain("context?.options?.docx?.visualPagination === true")
  13. })
  14. it('prevents spreadsheet sheet tabs from being compressed when many sheets exist', () => {
  15. const source = readSource('packages/core/src/renderers/spreadsheet.ts')
  16. expect(source).toContain("context?.options?.spreadsheet?.worker !== true")
  17. expect(source).toContain('.excel-wrapper .btn-group{min-width:0;max-width:100%;flex:1 1 auto;')
  18. expect(source).toContain('.excel-wrapper .sheet-tab{flex:0 0 auto;width:max-content;')
  19. expect(source).toContain('overflow-x:auto;overflow-y:hidden')
  20. })
  21. })