25 lines
747 B
TypeScript
25 lines
747 B
TypeScript
import {HTMLEntitiesEncoder} from './htmlentities-encoder';
|
|
|
|
describe('HTMLEntitiesEncoder', () => {
|
|
let sut: HTMLEntitiesEncoder;
|
|
|
|
beforeEach(() => sut = new HTMLEntitiesEncoder());
|
|
|
|
it('should create an instance', () => {
|
|
expect(sut).toBeTruthy();
|
|
});
|
|
|
|
it('should have a display name', () => {
|
|
expect(sut.getDisplayname()).toBeTruthy();
|
|
});
|
|
|
|
it('should have the id "encodehtmlentities"', () => {
|
|
expect(sut.getId()).toEqual('encodehtmlentities');
|
|
});
|
|
|
|
it('should encode "<span>"Hi" & "Lo"</span>" to "<span>"Hi" & "Lo"</span>"', () => {
|
|
expect(sut.convert('<span>"Hi" & "Lo"</span>'))
|
|
.toEqual('<span>"Hi" & "Lo"</span>');
|
|
});
|
|
});
|