import { decodeHtmlBrowser } from '../src/decodeHtmlBrowser' describe('decodeHtmlBrowser', () => { it('should decode HTML correctly', () => { expect(decodeHtmlBrowser(' abc 123 ')).toBe(' abc 123 ') expect(decodeHtmlBrowser('&')).toBe('&') expect(decodeHtmlBrowser('&')).toBe('&') expect(decodeHtmlBrowser('&amp;')).toBe('&') expect(decodeHtmlBrowser('<')).toBe('<') expect(decodeHtmlBrowser('<')).toBe('<') expect(decodeHtmlBrowser('&lt;')).toBe('<') expect(decodeHtmlBrowser('>')).toBe('>') expect(decodeHtmlBrowser('>')).toBe('>') expect(decodeHtmlBrowser('&gt;')).toBe('>') expect(decodeHtmlBrowser(' ')).toBe('\u00a0') expect(decodeHtmlBrowser('"')).toBe('"') expect(decodeHtmlBrowser(''')).toBe("'") expect(decodeHtmlBrowser('É')).toBe('\u00c9') expect(decodeHtmlBrowser('É')).toBe('\u00c9') expect(decodeHtmlBrowser('É')).toBe('\u00c9') // #3001 html tags inside attribute values expect(decodeHtmlBrowser('Text', true)).toBe( 'Text' ) expect(decodeHtmlBrowser('&', true)).toBe( '&' ) expect( decodeHtmlBrowser( '<strong>&</strong>', true ) ).toBe('&') }) })