mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-14 22:09:29 +02:00
add unit tests for coverage #6795
This commit is contained in:
@@ -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');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user