mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 06:19:24 +02:00
test: add tests for directions in flowchart
This commit is contained in:
@@ -126,3 +126,20 @@ describe('flow db getData', () => {
|
||||
expect(edges[0].curve).toBe('basis');
|
||||
});
|
||||
});
|
||||
|
||||
describe('flow db direction', () => {
|
||||
let flowDb: FlowDB;
|
||||
beforeEach(() => {
|
||||
flowDb = new FlowDB();
|
||||
});
|
||||
|
||||
it('should set direction to TB when TD is set', () => {
|
||||
flowDb.setDirection('TD');
|
||||
expect(flowDb.getDirection()).toBe('TB');
|
||||
});
|
||||
|
||||
it('should correctly set direction irrespective of leading spaces', () => {
|
||||
flowDb.setDirection(' TD');
|
||||
expect(flowDb.getDirection()).toBe('TB');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user