diff --git a/tests/unit/substitutionsTest.ts b/tests/unit/substitutionsTest.ts index d52688fe..79c78e00 100644 --- a/tests/unit/substitutionsTest.ts +++ b/tests/unit/substitutionsTest.ts @@ -297,34 +297,38 @@ describe("Substitutions", () => { }); }); - // describe("slackTextToMatrixHTML", () => { - // it("should repeat a plain string", async () => { - // const res = await substitutions.slackTextToMatrixHTML("Hello World!"); - // expect(res).to.equal("Hello World!"); - // }); - // it("should convert < and >", async () => { - // const res = await substitutions.slackTextToMatrixHTML("Hello"); - // expect(res).to.equal("<html>Hello</html>"); - // }); - // it("should convert a single new line to a
", async () => { - // const res = substitutions.slackTextToMatrixHTML("line 1\nline 2"); - // expect(res).to.equal("line 1
line 2"); - // }); - // it("should convert two new lines to paragraphs", async () => { - // const res = substitutions.slackTextToMatrixHTML("line 1\n\nline 3"); - // expect(res).to.equal("

line 1

line 3

"); - // }); - // it("should convert bold formatting", async () => { - // const res = substitutions.slackTextToMatrixHTML("This is *bold*!"); - // expect(res).to.equal("This is bold!"); - // }); - // it("should convert italic formatting", async () => { - // const res = substitutions.slackTextToMatrixHTML("This is /italics/!"); - // expect(res).to.equal("This is italics!"); - // }); - // it("should convert strikethrough formatting", async () => { - // const res = substitutions.slackTextToMatrixHTML("This is ~strikethrough~!"); - // expect(res).to.equal("This is strikethrough"); - // }); - // }); + describe("slackToMatrix", () => { + it("should repeat a plain string", async () => { + const res = await substitutions.slackToMatrix("Hello World!"); + expect(res).to.equal("Hello World!"); + }); + // it("should convert < and >", async () => { + // const res = await substitutions.slackToMatrix("Hello"); + // expect(res).to.equal("<html>Hello</html>"); + // }); + // it("should convert a single new line to a
", async () => { + // const res = substitutions.slackToMatrix("line 1\nline 2"); + // expect(res).to.equal("line 1
line 2"); + // }); + // it("should convert two new lines to paragraphs", async () => { + // const res = substitutions.slackToMatrix("line 1\n\nline 3"); + // expect(res).to.equal("

line 1

line 3

"); + // }); + // it("should convert bold formatting", async () => { + // const res = substitutions.slackToMatrix("This is *bold*!"); + // expect(res).to.equal("This is bold!"); + // }); + // it("should convert italic formatting", async () => { + // const res = substitutions.slackToMatrix("This is /italics/!"); + // expect(res).to.equal("This is italics!"); + // }); + // it("should convert strikethrough formatting", async () => { + // const res = substitutions.slackToMatrix("This is ~strikethrough~!"); + // expect(res).to.equal("This is strikethrough"); + // }); + it("should fallback to colon-codes for unknown emojis", async () => { + const res = substitutions.slackToMatrix(":+1: :drizzt:"); + expect(res).to.equal("👍 :drizzt:"); + }); + }); });