chore: Fix unit tests

This commit is contained in:
Sidharth Vinod 2023-09-05 21:41:49 +05:30
parent c38478f6c3
commit fd7406b94a
No known key found for this signature in database
GPG Key ID: FB5CCD378D3907CD
1 changed files with 8 additions and 10 deletions

View File

@ -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 () {