mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-30 12:49:41 +02:00
Add test
This commit is contained in:
@@ -126,4 +126,14 @@ describe('Configuration', () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
it('should not render error diagram if suppressErrorRendering is set', () => {
|
||||
const url = 'http://localhost:9000/regression/issue-1874.html';
|
||||
cy.viewport(1440, 1024);
|
||||
cy.visit(url);
|
||||
cy.get('#test');
|
||||
cy.matchImageSnapshot(
|
||||
'configuration.spec-should-not-render-error-diagram-if-suppressErrorRendering-is-set'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
32
cypress/platform/suppressError.html
Normal file
32
cypress/platform/suppressError.html
Normal file
@@ -0,0 +1,32 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<title>Mermaid Quick Test Page</title>
|
||||
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="test">
|
||||
<pre class="mermaid">
|
||||
flowchart
|
||||
a[This should be visible]
|
||||
</pre
|
||||
>
|
||||
<pre class="mermaid">
|
||||
flowchart
|
||||
a --< b
|
||||
</pre
|
||||
>
|
||||
<pre class="mermaid">
|
||||
flowchart
|
||||
a[This should be visible, error diagram should not be visible above this]
|
||||
</pre
|
||||
>
|
||||
</div>
|
||||
<script type="module">
|
||||
import mermaid from './mermaid.esm.mjs';
|
||||
mermaid.initialize({ startOnLoad: true, suppressErrorRendering: true });
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user