mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-15 13:29:40 +02:00
fix(class): #5624 Reset direction to default in classDiagram
This commit is contained in:
@@ -113,6 +113,7 @@ export const clear = function () {
|
||||
functions.push(setupToolTips);
|
||||
namespaces = new Map();
|
||||
namespaceCounter = 0;
|
||||
direction = 'TB';
|
||||
commonClear();
|
||||
};
|
||||
|
||||
|
@@ -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 () {
|
||||
|
Reference in New Issue
Block a user