mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 23:09:49 +02:00
test(common): add generic parser test
This commit is contained in:
@@ -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>');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user