test: Verify label is sanitized

Co-authored-by: Chris Grieger <chris@scolp.de>
This commit is contained in:
Sidharth Vinod
2025-08-08 12:55:18 +05:30
parent e539909e87
commit 096fbe933e

View File

@@ -152,4 +152,15 @@ describe('XSS', () => {
cy.wait(1000);
cy.get('#the-malware').should('not.exist');
});
it('should sanitize labels', () => {
const str = JSON.stringify({
code: `erDiagram
"<img src=x onerror=xssAttack()>" ||--|| ENTITY2 : "<img src=x onerror=xssAttack()>"
`,
});
imgSnapshotTest(utf8ToB64(str), {}, true);
cy.wait(1000);
cy.get('#the-malware').should('not.exist');
});
});