import { markdownHtmlAgent } from '../src/services/markdownHtmlAgent'; describe('markdownHtmlAgent basic functionality', () => { it('should convert simple markdown to HTML with title and content', async () => { const markdown = `# Section 1\n\nThis is **bold** and *italic* text.`; const html = await markdownHtmlAgent({ title: 'Document Title', markdown, date: '2020-01-01', }); // Should include the cover page title expect(html).toContain('

Document Title

'); // The first markdown title is treated as cover page and removed; content should include paragraph expect(html).toContain('

This is bold and italic text.

'); expect(html).toContain('bold'); expect(html).toContain('italic'); // Should include the date on cover page expect(html).toContain('2020-01-01'); }); it('should generate a table of contents for multiple headings', async () => { // Need at least 5 headings total (including cover title) for TOC generation const markdownTOC = `# Main\n## First Section\n### Subsection A\n## Second Section\n## Third Section\n\nParagraph content.`; const htmlTOC = await markdownHtmlAgent({ title: 'Doc', markdown: markdownTOC }); // TOC should appear after cover page expect(htmlTOC).toContain('