/** * Internal dependencies */ import { decodeEntities } from '..'; describe( 'decodeEntities', () => { it( 'should not change html with no entities', () => { const html = '

A noble tag embiggens the smallest text.

'; const expected = '

A noble tag embiggens the smallest text.

'; expect( decodeEntities( html ) ).toEqual( expected ); } ); it( 'should decode entities', () => { const html = '<h1>This post’s title.</h1>'; const expected = '

This post’s title.

'; expect( decodeEntities( html ) ).toEqual( expected ); } ); it( 'should not double decode entities', () => { const html = 'This post&rsquo;s title.'; const expected = 'This post’s title.'; expect( decodeEntities( html ) ).toEqual( expected ); } ); it( 'should not care about leading zeros on entity codes', () => { const html = 'Jim's mother's post's title.'; const expected = "Jim's mother's post's title."; expect( decodeEntities( html ) ).toEqual( expected ); } ); } );