add test for HTML

This commit is contained in:
C. Fuhrman 2024-09-15 22:49:03 -04:00
parent 868ac21f43
commit b502d2ab23

View file

@ -63,8 +63,18 @@ describe('TextType', () => {
text: '**Bold**',
format: 'markdown'
};
const expectedOutput = '<strong>Bold</strong>';
expect(TextType({ text: input })).toContain(expectedOutput);
// TODO: investigate why the output has an extra newline
const expectedOutput = '<strong>Bold</strong>\n';
expect(TextType({ text: input })).toBe(expectedOutput);
});
it('should format text with HTML correctly', () => {
const input: TextFormat = {
text: '<em>yes</em>',
format: 'html'
};
const expectedOutput = '<em>yes</em>';
expect(TextType({ text: input })).toBe(expectedOutput);
});
it('should format plain text correctly', () => {