test(common): add generic parser test

This commit is contained in:
FlorianWoelki 2022-08-20 14:08:53 +02:00
parent ecf62e3b7a
commit e19581b540
1 changed files with 8 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import { sanitizeText, removeScript, removeEscapes } from './common';
import { sanitizeText, removeScript, removeEscapes, parseGenericTypes } from './common';
describe('when securityLevel is antiscript, all script must be removed', function () {
/**
@ -103,3 +103,10 @@ describe('Sanitize text', function () {
expect(result).not.toContain('javascript:alert(1)');
});
});
describe('generic parser', function () {
it('should parse generic types', function () {
const result = parseGenericTypes('test~T~');
expect(result).toEqual('test<T>');
});
});