Updated classdiagrams with the new syntax

This commit is contained in:
Knut Sveidqvist
2022-04-30 14:54:24 +02:00
parent 85e157f0d3
commit 5e6b4d73e1
3 changed files with 44 additions and 37 deletions

View File

@@ -543,20 +543,33 @@ foo()
expect(relations[0].relation.lineType).toBe(classDb.lineType.LINE);
});
it('should have a title and accDescription', function () {
const str =
'classDiagram\n' +
'class Car~T~\n' +
'title My Title\n' +
'accDescription My Description\n';
'Car : -List~Wheel~ wheels\n' +
'Car : +setWheels(List~Wheel~ wheels)\n' +
'Car : +getWheels() List~Wheel~';
it('should handle accTitle and accDescr', function () {
const str = `classDiagram
accTitle: My Title
accDescr: My Description
Class01 <|-- Class02
`;
parser.parse(str);
expect(parser.yy.getTitle()).toBe('My Title');
expect(parser.yy.getAccDescription()).toBe('My Description');
});
it('should handle accTitle and multiline accDescr', function () {
const str = `classDiagram
accTitle: My Title
accDescr {
This is mu multi
line description
}
Class01 <|-- Class02
`;
parser.parse(str);
expect(parser.yy.getTitle()).toBe('My Title');
expect(parser.yy.getAccDescription()).toBe('This is mu multi\nline description');
});
it('should handle relation definitions AGGREGATION and dotted line', function () {
const str = 'classDiagram\n' + 'Class01 o.. Class02';