Skip to content

Commit

Permalink
test: Add flow-lines non-numbered
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 committed Sep 6, 2023
1 parent 031fefe commit d29ee25
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/mermaid/src/diagrams/flowchart/parser/flow-lines.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,31 @@ describe('[Lines] when parsing', () => {
`);
});

it('should handle non-numbered line style', function () {
flow.parser.parse(
'graph TD\n' +
'A-->B\n' +
'linkStyle - stroke-width:1px;\n' +
'A-->C\n' +
'linkStyle - stroke-width:3px;'
);

const edges = flow.parser.yy.getEdges();

expect(edges[0].style).toMatchInlineSnapshot(`
[
"stroke-width:1px",
"fill:none",
]
`);
expect(edges[1].style).toMatchInlineSnapshot(`
[
"stroke-width:3px",
"fill:none",
]
`);
});

it('should handle line interpolation multi-numbered with style', function () {
flow.parser.parse(
'graph TD\n' + 'A-->B\n' + 'A-->C\n' + 'linkStyle 0,1 interpolate basis stroke-width:1px;'
Expand Down

0 comments on commit d29ee25

Please sign in to comment.