Files
lehuo/apps/admin-web/src/financial-document.spec.ts
T

11 lines
482 B
TypeScript

import { describe, expect, it } from 'vitest';
import { defaultFinancialSummary, htmlToPlainText } from './financial-document';
describe('financial document helpers', () => {
it('creates a short readable summary from imported HTML', () => {
expect(htmlToPlainText('<h1>年度报告</h1><p>公益项目执行情况</p>')).toBe(
'年度报告公益项目执行情况',
);
expect(defaultFinancialSummary(`<p>${'财'.repeat(130)}</p>`)).toHaveLength(120);
});
});