add unit tests for coverage #6795

This commit is contained in:
Hashan Chandika
2025-07-27 15:21:46 +05:30
parent ac04172cf8
commit 5e8aa2dccf

View File

@@ -78,5 +78,41 @@ describe('diagram-orchestration', () => {
flowchart: 1 "pie" pie: 2 "pie"`)
).toBe('pie');
});
it('should detect proper diagram when defaultRenderer is elk for flowchart', () => {
expect(
detectType('mindmap\n root\n Photograph\n Waterfall', {
flowchart: { defaultRenderer: 'elk' },
})
).toBe('mindmap');
expect(
detectType(
`
classDiagram
class Person {
+String name
-Int id
#double age
+Text demographicProfile
}
`,
{ flowchart: { defaultRenderer: 'elk' } }
)
).toBe('class');
expect(
detectType(
`
erDiagram
p[Photograph] {
varchar(12) jobId
date dateCreated
}
`,
{
flowchart: { defaultRenderer: 'elk' },
}
)
).toBe('er');
});
});
});