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

15 lines
627 B
TypeScript

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