mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +08:00
Add test for handling parameter names that are "default"
This commit is contained in:
parent
2cf9348f53
commit
8c56f68a06
@ -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');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user