From ff673fc98d22d7a8818dd452c0bda66de0506fcd Mon Sep 17 00:00:00 2001 From: Mark Said Camilleri Date: Sun, 21 Jan 2024 01:48:14 +0000 Subject: [PATCH] Attempt at adding tests for the chinese case --- tests/functions.test.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/functions.test.ts b/tests/functions.test.ts index a30db3f..65ae7f6 100644 --- a/tests/functions.test.ts +++ b/tests/functions.test.ts @@ -143,4 +143,28 @@ describe("replaceContentWithPageLinks()", () => { `This block implicitly contains unicode words like [[가나다]].` ); }); + + it("should replace links made up of CJKV characters", () => { + let [content, update] = replaceContentWithPageLinks( + ["书架"], + `This block implicitly contains CJKV words like 书架.`, + false, + false + ); + expect(content).toBe( + `This block implicitly contains CJKV words like [[书架]].` + ); + }); + + it("should replace links made up of CJKV characters with tags", () => { + let [content, update] = replaceContentWithPageLinks( + ["书架"], + `This block implicitly contains CJKV words like 书架.`, + true, + false + ); + expect(content).toBe( + `This block implicitly contains CJKV words like #书架.` + ); + }); });