1 import { escapeInvalidHtmlTags } from './sanitize';
3 describe('escapeInvalidHtmlTags', () => {
4 it('should escape invalid HTML tags', () => {
5 const input = 'Test <salut> <b>hello</b> </salut>';
6 const output = 'Test <salut> <b>hello</b> </salut>';
7 expect(escapeInvalidHtmlTags(input)).toBe(output);
10 it('should escape standalone brackets', () => {
11 const input = '<only one bracket <b>before</b>';
12 const output = '<only one bracket <b>before</b>';
13 expect(escapeInvalidHtmlTags(input)).toBe(output);
16 it('should escape standalone brackets', () => {
17 const input = 'only <b>one</b> bracket after>';
18 const output = 'only <b>one</b> bracket after>';
19 expect(escapeInvalidHtmlTags(input)).toBe(output);