From b502d2ab2301ec32b0ffaa846f9cdc64253d5beb Mon Sep 17 00:00:00 2001 From: "C. Fuhrman" Date: Sun, 15 Sep 2024 22:49:03 -0400 Subject: [PATCH] add test for HTML --- .../components/GiftTemplate/TextType.test.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/client/src/__tests__/components/GiftTemplate/TextType.test.ts b/client/src/__tests__/components/GiftTemplate/TextType.test.ts index 9441b58..2b4fc47 100644 --- a/client/src/__tests__/components/GiftTemplate/TextType.test.ts +++ b/client/src/__tests__/components/GiftTemplate/TextType.test.ts @@ -63,8 +63,18 @@ describe('TextType', () => { text: '**Bold**', format: 'markdown' }; - const expectedOutput = 'Bold'; - expect(TextType({ text: input })).toContain(expectedOutput); + // TODO: investigate why the output has an extra newline + const expectedOutput = 'Bold\n'; + expect(TextType({ text: input })).toBe(expectedOutput); + }); + + it('should format text with HTML correctly', () => { + const input: TextFormat = { + text: 'yes', + format: 'html' + }; + const expectedOutput = 'yes'; + expect(TextType({ text: input })).toBe(expectedOutput); }); it('should format plain text correctly', () => {