mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-08 08:39:38 +02:00
test: sankey, pie, seq diagram
This commit is contained in:
@@ -140,10 +140,12 @@ describe('pie', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should handle unsafe properties', async () => {
|
it('should handle unsafe properties', async () => {
|
||||||
await expect(parser.parse(`pie title Unsafe props test
|
await expect(
|
||||||
|
parser.parse(`pie title Unsafe props test
|
||||||
"__proto__" : 386
|
"__proto__" : 386
|
||||||
"constructor" : 85
|
"constructor" : 85
|
||||||
"prototype" : 15`)).resolves.toBeUndefined();
|
"prototype" : 15`)
|
||||||
|
).resolves.toBeUndefined();
|
||||||
expect([...db.getSections().keys()]).toEqual(['__proto__', 'constructor', 'prototype']);
|
expect([...db.getSections().keys()]).toEqual(['__proto__', 'constructor', 'prototype']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -22,10 +22,12 @@ describe('Sankey diagram', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('allows __proto__ as id', function () {
|
it('allows __proto__ as id', function () {
|
||||||
sankey.parser.parse(prepareTextForParsing(`sankey-beta
|
sankey.parser.parse(
|
||||||
|
prepareTextForParsing(`sankey-beta
|
||||||
__proto__,A,0.597
|
__proto__,A,0.597
|
||||||
A,__proto__,0.403
|
A,__proto__,0.403
|
||||||
`));
|
`)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -2035,8 +2035,10 @@ participant Alice`;
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each(['__proto__', 'constructor'])('should allow %s as an actor name', function (prop) {
|
it.each(['__proto__', 'constructor'])('should allow %s as an actor name', function (prop) {
|
||||||
mermaidAPI.parse(`
|
expect(
|
||||||
|
mermaidAPI.parse(`
|
||||||
sequenceDiagram
|
sequenceDiagram
|
||||||
${prop}-->>A: Hello, how are you?`);
|
${prop}-->>A: Hello, how are you?`)
|
||||||
|
).resolves.toBeDefined();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user