Skip to content

Commit

Permalink
Added more specs for elk detector
Browse files Browse the repository at this point in the history
  • Loading branch information
nirname committed Jun 19, 2024
1 parent 5587011 commit 6382dcf
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/mermaid-flowchart-elk/src/detector.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,26 @@ describe('flowchart-elk detector', () => {
).toBe(true);
});

// The error from the issue was reproduced with mindmap, so this is just an example
// what matters is the keyword somewhere inside graph definition
it('should check only the beginning of the line in search of keywords', () => {
expect(
detector('mindmap ["Descendant node in flowchart"]', {
flowchart: {
defaultRenderer: 'elk',
},
})
).toBe(false)

expect(
detector('mindmap ["Descendant node in graph"]', {
flowchart: {
defaultRenderer: 'elk',
},
})
).toBe(false)
});

it('should detect flowchart-elk', () => {
expect(detector('flowchart-elk')).toBe(true);
});
Expand Down

0 comments on commit 6382dcf

Please sign in to comment.