Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

fix(export): include the guide description in docx

Luis Ortiz2e9f297407eb
diff --git a/src/core/export/__tests__/docx-export.test.ts b/src/core/export/__tests__/docx-export.test.ts
index 170c900..e86a8b9 100644
--- a/src/core/export/__tests__/docx-export.test.ts
+++ b/src/core/export/__tests__/docx-export.test.ts
@@ -102,6 +102,13 @@ describe('exportGuideAsDOCX', () => {
expect(Object.keys(files).some((name) => name.startsWith('word/media/'))).toBe(false);
});
+ it('includes the guide description', async () => {
+ const guide = makeGuide({ description: 'A short SOP narrative.' });
+ const xml = await readDocumentXml(await exportGuideAsDOCX(guide, [makeStep()], new Map()));
+
+ expect(xml).toContain('A short SOP narrative.');
+ });
+
it('embeds the rendered screenshot so annotations and redactions are applied', async () => {
rendered.mockClear();
const step = makeStep();
diff --git a/src/core/export/docx-export.ts b/src/core/export/docx-export.ts
index 65a3944..7edbc6b 100644
--- a/src/core/export/docx-export.ts
+++ b/src/core/export/docx-export.ts
@@ -154,6 +154,16 @@ function buildCover(guide: Guide, steps: Step[], domain: string | null, brand: B
new TextRun({ text: guide.title, bold: true, color: INK, size: 60, font: DOCX_FONT_FAMILY }),
],
}),
+ ...(guide.description
+ ? [
+ new Paragraph({
+ spacing: { before: 220 },
+ children: [
+ new TextRun({ text: guide.description, color: MUTED, size: 22, font: DOCX_FONT_FAMILY }),
+ ],
+ }),
+ ]
+ : []),
],
CONTENT_MM - 40,
),