chore: Add test for invalid marker

This commit is contained in:
Sidharth Vinod 2023-11-09 02:38:48 +05:30
parent 4952b13ad0
commit 8f572021af
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD

View File

@ -64,4 +64,11 @@ describe('addEdgeMarker', () => {
`url(${url}#${id}_${diagramType}-compositionEnd)`
);
});
it('should not add invalid markers', () => {
const arrowTypeStart = 'this is an invalid marker';
const arrowTypeEnd = ') url(https://my-malicious-site.example)';
addEdgeMarkers(svgPath, { arrowTypeStart, arrowTypeEnd }, url, id, diagramType);
expect(svgPath.attr).not.toHaveBeenCalled();
});
});