Skip to content

Commit

Permalink
chore: Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 committed Sep 5, 2023
1 parent c38478f commit fd7406b
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions packages/mermaid/src/diagrams/class/classDiagram.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit fd7406b

Please sign in to comment.