converter/src/app/converter/htmlentities-decoder.spec.ts

15 lines
627 B
TypeScript

import {HTMLEntitiesDecoder} from './htmlentities-decoder';
describe('HTMLEntitiesDecoder', () => {
it('should create an instance', () => {
expect(new HTMLEntitiesDecoder()).toBeTruthy();
});
it('should have the id "decodehtmlentities"', () => {
expect(new HTMLEntitiesDecoder().getId()).toEqual('decodehtmlentities');
});
it('should decode "&lt;span&gt;&quot;Hi&quot; &amp; &quot;Lo&quot;&lt;/span&gt;" to "<span>"Hi" & "Lo"</span>"', () => {
expect(new HTMLEntitiesDecoder().convert('&lt;span&gt;&quot;Hi&quot; &amp; &quot;Lo&quot;&lt;/span&gt;'))
.toEqual('<span>"Hi" & "Lo"</span>');
});
});