mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
chore: Fix unit tests
This commit is contained in:
@@ -814,19 +814,17 @@ describe('given a class diagram with members and methods ', function () {
|
||||
});
|
||||
|
||||
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');
|
||||
parser.parse('classDiagram\n' + 'Car : wheels');
|
||||
const car = classDb.getClass('Car');
|
||||
expect(car.members.length).toBe(1);
|
||||
expect(car.members[0].id).toBe('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');
|
||||
parser.parse('classDiagram\n' + 'Car : int wheels');
|
||||
const car = classDb.getClass('Car');
|
||||
expect(car.members.length).toBe(1);
|
||||
expect(car.members[0].id).toBe('int wheels');
|
||||
});
|
||||
|
||||
it('should handle simple member declaration with type', function () {
|
||||
|
Reference in New Issue
Block a user