fix(class): #5624 Reset direction to default in classDiagram

This commit is contained in:
Sidharth Vinod
2024-07-07 16:28:57 +05:30
parent adf4351afd
commit a80dd711a7
2 changed files with 12 additions and 0 deletions

View File

@@ -113,6 +113,7 @@ export const clear = function () {
functions.push(setupToolTips);
namespaces = new Map();
namespaceCounter = 0;
direction = 'TB';
commonClear();
};

View File

@@ -444,6 +444,17 @@ class C13["With Città foreign language"]
]
`);
});
it('should revert direction to default once direction is removed', () => {
parser.parse(`classDiagram
direction RL
class A`);
expect(classDb.getDirection()).toBe('RL');
classDb.clear();
parser.parse(`classDiagram
class B`);
expect(classDb.getDirection()).toBe('TB');
});
});
describe('when parsing class defined in brackets', function () {