mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 23:09:49 +02:00
Add test for handling parameter names that are "default"
This commit is contained in:
@@ -66,4 +66,19 @@ Person(Person, "Person", "Person")`);
|
|||||||
expect(onlyShape.descr.text).toBe('Person');
|
expect(onlyShape.descr.text).toBe('Person');
|
||||||
expect(onlyShape.label.text).toBe('Person');
|
expect(onlyShape.label.text).toBe('Person');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should allow default in the parameters', function () {
|
||||||
|
flow.parser.parse(`C4Context
|
||||||
|
Person(default, "default", "default")`);
|
||||||
|
|
||||||
|
const yy = flow.parser.yy;
|
||||||
|
|
||||||
|
const shapes = yy.getC4ShapeArray();
|
||||||
|
expect(shapes.length).toBe(1);
|
||||||
|
const onlyShape = shapes[0];
|
||||||
|
|
||||||
|
expect(onlyShape.alias).toBe('default');
|
||||||
|
expect(onlyShape.descr.text).toBe('default');
|
||||||
|
expect(onlyShape.label.text).toBe('default');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user