mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-31 22:26:53 +02:00
feat: add mermaidAPI.registerDiagram()
Exposes the registerDiagram() function publically as `mermaid.mermaidAPI.registerDiagram` so that users can add their own diagrams at bundle-time. This is instead of using the lazyLoadedDiagrams config setting.
This commit is contained in:
13
cypress/integration/other/external-diagrams.spec.js
Normal file
13
cypress/integration/other/external-diagrams.spec.js
Normal file
@@ -0,0 +1,13 @@
|
||||
describe('mermaid', () => {
|
||||
describe('registerDiagram', () => {
|
||||
it('should work on @mermaid-js/mermaid-mindmap and mermaid-example-diagram', () => {
|
||||
const url = 'http://localhost:9000/external-diagrams-mindmap.html';
|
||||
cy.visit(url);
|
||||
|
||||
cy.get('svg', {
|
||||
// may be a bit slower than normal, since vite might need to re-compile mermaid/mermaid-mindmap/mermaid-example-diagram
|
||||
timeout: 10000,
|
||||
}).matchImageSnapshot();
|
||||
});
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user