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