From ea07672a2db88d04fe85e22ff5a45627edd11416 Mon Sep 17 00:00:00 2001 From: Abdullah Atta Date: Wed, 23 Nov 2022 16:17:27 +0500 Subject: [PATCH] web: update test snapshots --- .../export-html-Chromium-linux.txt | 8 ++++---- .../notes.test.ts-snapshots/export-md-Chromium-linux.txt | 3 --- .../notes.test.ts-snapshots/export-txt-Chromium-linux.txt | 3 +-- apps/web/src/common/export.ts | 6 ++++-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-linux.txt b/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-linux.txt index 69f5d5dfa..50dd65724 100644 --- a/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-linux.txt +++ b/apps/web/__e2e__/notes.test.ts-snapshots/export-html-Chromium-linux.txt @@ -7,13 +7,13 @@ name="description" content="This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1" /> - Test 1 - Notesnook + Test 1 - Notesnook + + +

Test 1

This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1

-
- Created on: xxx
- Edited on: xxx diff --git a/apps/web/__e2e__/notes.test.ts-snapshots/export-md-Chromium-linux.txt b/apps/web/__e2e__/notes.test.ts-snapshots/export-md-Chromium-linux.txt index e479a1902..ef91db9ea 100644 --- a/apps/web/__e2e__/notes.test.ts-snapshots/export-md-Chromium-linux.txt +++ b/apps/web/__e2e__/notes.test.ts-snapshots/export-md-Chromium-linux.txt @@ -5,6 +5,3 @@ This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1 --- -_Created on: xxx_ - -_Edited on: xxx_ \ No newline at end of file diff --git a/apps/web/__e2e__/notes.test.ts-snapshots/export-txt-Chromium-linux.txt b/apps/web/__e2e__/notes.test.ts-snapshots/export-txt-Chromium-linux.txt index 6c39fd390..aa657e922 100644 --- a/apps/web/__e2e__/notes.test.ts-snapshots/export-txt-Chromium-linux.txt +++ b/apps/web/__e2e__/notes.test.ts-snapshots/export-txt-Chromium-linux.txt @@ -4,5 +4,4 @@ Test 1 This is Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1Test 1 ---------- -Created on: xxx -Edited on: xxx \ No newline at end of file +Tags: \ No newline at end of file diff --git a/apps/web/src/common/export.ts b/apps/web/src/common/export.ts index f895212aa..d437f90af 100644 --- a/apps/web/src/common/export.ts +++ b/apps/web/src/common/export.ts @@ -56,7 +56,9 @@ export async function exportNotes( if (format === "pdf") { const note = db.notes?.note(noteIds[0]); if (!note) return false; - return await exportToPDF(note.title, await note.export("html", null)); + const html = await note.export("html", null); + if (!html) return false; + return await exportToPDF(note.title, html); } const files = []; @@ -70,7 +72,7 @@ export async function exportNotes( text: `Exporting "${note.title}"...` }); console.log("Exporting", note.title); - const content: string = await note.export(format, null).catch((e) => { + const content = await note.export(format, null).catch((e) => { showToast("error", e.message); }); if (!content) continue;