test: add tests for directions in flowchart

This commit is contained in:
Krishna Upadhyay
2025-07-10 22:17:30 -05:00
parent e9ce8cf4da
commit 98bf9b4cb4

View File

@@ -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');
});
});