import htmlUtils, { extractHtmlBody } from './htmlUtils'; describe('htmlUtils', () => { test('should strip off HTML', () => { const testCases = [ [ '', '', ], [ 'test', 'test', ], [ 'Joplin®', 'JoplinĀ®', ], [ '<b>test</b>', '<b>test</b>', ], ]; for (const t of testCases) { const [input, expected] = t; const actual = htmlUtils.stripHtml(input); expect(actual).toBe(expected); } }); test('should extract the HTML body', () => { const testCases: [string, string][] = [ [ 'Just testing', 'Just testing', ], [ '', '', ], [ 'Here is the body', 'Here is the body', ], ]; for (const [input, expected] of testCases) { const actual = extractHtmlBody(input); expect(actual).toBe(expected); } }); });