From f0ba056bb755c42ffe5bf2a690905775559fc4f5 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Fri, 31 Jan 2025 23:47:55 +0100 Subject: [PATCH] test(server/utils): add tests for escapeHtml & unescapeHtml --- src/services/utils.spec.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/services/utils.spec.ts b/src/services/utils.spec.ts index 9669acfd0..ad5c0841c 100644 --- a/src/services/utils.spec.ts +++ b/src/services/utils.spec.ts @@ -108,11 +108,17 @@ describe("#sanitizeSqlIdentifier", () => { }); -// TriliumNextTODO: should use mocks and assert that functions get called -describe.todo("#escapeHtml", () => {}); +describe("#escapeHtml", () => { + it("should re-export 'escape-html' npm module as escapeHtml", () => { + expect(utils.escapeHtml).toBeTypeOf("function"); + }); +}); -// TriliumNextTODO: should use mocks and assert that functions get called -describe.todo("#unescapeHtml", () => {}); +describe("#unescapeHtml", () => { + it("should re-export 'unescape' npm module as unescapeHtml", () => { + expect(utils.unescapeHtml).toBeTypeOf("function"); + }); +}); describe.todo("#toObject", () => {});