import { splitHtml, SplittedHtml } from './HtmlToHtml'; describe('HtmlToHtml', () => { test('should split an HTML string into HTML and CSS', () => { const testCases: [string, SplittedHtml][] = [ [ '', { html: '', css: '', }, ], [ '\n
hello
\n

another line

', { html: '\n
hello
\n

another line

', css: 'b { font-weight: bold; }', }, ], [ '\n
hello
', { html: '\n
hello
', css: 'b { font-weight: bold; }', }, ], [ '\n
hello
', { html: '\n
hello
', css: '', }, ], // cSpell:disable [ `




-------- Message transféré --------
Sujet : Your car rental booking DC-7706328 is confirmed (pick-up on 1 October 2024)
`, { html: `




-------- Message transféré --------
Sujet : Your car rental booking DC-7706328 is confirmed (pick-up on 1 October 2024)
`, css: '', }, ], // cSpell:enable ]; for (const t of testCases) { const [input, expected] = t; const actual = splitHtml(input); expect(actual).toEqual(expected); } }); });