feat(renderer): Phase 9 foundation — settings, modal union, ipc, commands, docx-export

This commit is contained in:
2026-06-06 07:33:00 +05:30
parent 094b52a2b3
commit a8f7547c7e
10 changed files with 161 additions and 6 deletions
+24
View File
@@ -0,0 +1,24 @@
import { describe, it, expect } from 'vitest';
import { generateDocx } from '@/lib/docx-export';
describe('generateDocx', () => {
it('returns a Blob for a simple markdown string', async () => {
const blob = await generateDocx({ source: '# Hello\n\nWorld' });
expect(blob).toBeInstanceOf(Blob);
expect(blob.size).toBeGreaterThan(0);
expect(blob.type).toBe('application/vnd.openxmlformats-officedocument.wordprocessingml.document');
});
it('converts headings to docx heading styles', async () => {
const blob = await generateDocx({ source: '# H1\n## H2\n### H3' });
// The blob should be a valid zip-based docx; check size and MIME
expect(blob.size).toBeGreaterThan(0);
});
it('converts markdown tables to preformatted (via applyAsciiTransform)', async () => {
const source = '| A | B |\n| - | - |\n| 1 | 2 |';
const blob = await generateDocx({ source });
expect(blob).toBeInstanceOf(Blob);
expect(blob.size).toBeGreaterThan(0);
});
});