Added more specs for elk detector

This commit is contained in:
Nikolay Rozhkov
2024-06-19 22:36:10 +03:00
parent 5587011f75
commit 6382dcf7c8

View File

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