Fixed styling for lines for ELK flowchart

This commit is contained in:
itsalam
2023-09-15 13:17:13 -07:00
committed by Vincent Lam
parent 5f117fc2b2
commit c08f927d60
3 changed files with 51 additions and 4 deletions

View File

@@ -844,3 +844,43 @@ end
});
});
});
describe('Title and arrow styling #4813', () => {
it('should render a flowchart with title', () => {
const titleString = 'Test Title';
renderGraph(
`---
title: ${titleString}
---
flowchart LR
A-->B`,
{ flowchart: { defaultRenderer: "elk" } }
);
cy.get('svg').should((svg) => {
const title = svg[0].querySelector('text');
expect(title.textContent).to.contain(titleString);
});
});
it('Render with stylized arrows', () => {
const titleString = 'Test Title';
renderGraph(
`
flowchart LR
A-->B
B-.-oC
C==xD
D ~~~ A`,
{ flowchart: { defaultRenderer: "elk" } }
);
cy.get('svg').should((svg) => {
const edges = svg[0].querySelectorAll('.edges path');
expect(edges[0]).to.have.attr('pattern', 'solid');
expect(edges[1]).to.have.attr('pattern', 'dotted');
expect(edges[2]).to.have.css('stroke-width', '3.5px');
expect(edges[3]).to.have.css('stroke-width', '1.5px');
});
});
})