From be19fef5928095a236f608ef4c63fec950af695f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Ska=C5=82ka?= Date: Thu, 16 Jan 2025 09:41:05 +0100 Subject: [PATCH] Add tests --- __tests__/ExpensiMark-HTML-test.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/__tests__/ExpensiMark-HTML-test.js b/__tests__/ExpensiMark-HTML-test.js index 3eef3952..0286b4ae 100644 --- a/__tests__/ExpensiMark-HTML-test.js +++ b/__tests__/ExpensiMark-HTML-test.js @@ -1978,6 +1978,34 @@ describe('when should keep raw input flag is enabled', () => { expect(parser.replace(testString, {shouldKeepRawInput: true})).toBe(resultString); }); }); + + describe('inline code blocks', () => { + test('empty content', () => { + const testString = '``'; + const resultString = '``'; + expect(parser.replace(testString, {shouldKeepRawInput: true})).toBe(resultString); + }); + test('single whitespace as a content', () => { + const testString = '` `'; + const resultString = ' '; + expect(parser.replace(testString, {shouldKeepRawInput: true})).toBe(resultString); + }); + test('multiple whitespaces as a content', () => { + const testString = '` `'; + const resultString = ' '; + expect(parser.replace(testString, {shouldKeepRawInput: true})).toBe(resultString); + }); + test('text content', () => { + const testString = 'hello `world`'; + const resultString = 'hello world'; + expect(parser.replace(testString, {shouldKeepRawInput: true})).toBe(resultString); + }); + test('text and whitespaces as a content', () => { + const testString = '` hello world `'; + const resultString = ' hello world '; + expect(parser.replace(testString, {shouldKeepRawInput: true})).toBe(resultString); + }); + }); }); test('Test code fence within inline code', () => {