21 lines
650 B
TypeScript
21 lines
650 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 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>');
|
|
});
|
|
});
|