mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 15:30:03 +02:00
feat: #2685 Support class member initialization by member definition
This commit is contained in:
@@ -742,6 +742,22 @@ describe('given a class diagram with members and methods ', function () {
|
||||
parser.parse(str);
|
||||
});
|
||||
|
||||
it('should handle direct member declaration', function () {
|
||||
const str = 'classDiagram\n' + 'Car : wheels';
|
||||
|
||||
parser.parse(str);
|
||||
expect(classDb.getClasses()).toHaveProperty('Car');
|
||||
expect(classDb.getClasses()['Car']['members']).toContain('wheels');
|
||||
});
|
||||
|
||||
it('should handle direct member declaration with type', function () {
|
||||
const str = 'classDiagram\n' + 'Car : int wheels';
|
||||
|
||||
parser.parse(str);
|
||||
expect(classDb.getClasses()).toHaveProperty('Car');
|
||||
expect(classDb.getClasses()['Car']['members']).toContain('int wheels');
|
||||
});
|
||||
|
||||
it('should handle simple member declaration with type', function () {
|
||||
const str = 'classDiagram\n' + 'class Car\n' + 'Car : int wheels';
|
||||
|
||||
|
Reference in New Issue
Block a user