mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-19 16:26:43 +02:00
test: External diagram rendering test
This commit is contained in:
@@ -73,7 +73,7 @@ export const imgSnapshotTest = (
|
|||||||
|
|
||||||
export const urlSnapshotTest = (
|
export const urlSnapshotTest = (
|
||||||
url: string,
|
url: string,
|
||||||
options: CypressMermaidConfig,
|
options: CypressMermaidConfig = {},
|
||||||
_api = false,
|
_api = false,
|
||||||
validation?: any
|
validation?: any
|
||||||
): void => {
|
): void => {
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import { imgSnapshotTest } from '../../helpers/util.ts';
|
import { imgSnapshotTest, urlSnapshotTest } from '../../helpers/util.ts';
|
||||||
|
|
||||||
describe.skip('architecture diagram', () => {
|
describe.skip('architecture diagram', () => {
|
||||||
it('should render a simple architecture diagram with groups', () => {
|
it('should render a simple architecture diagram with groups', () => {
|
||||||
@@ -172,3 +172,7 @@ describe.skip('architecture diagram', () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should allow adding external icons', () => {
|
||||||
|
urlSnapshotTest('http://localhost:9000/architecture-external.html');
|
||||||
|
});
|
||||||
|
39
cypress/platform/architecture-external.html
Normal file
39
cypress/platform/architecture-external.html
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<title>Architecture Mermaid Test Page</title>
|
||||||
|
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgo=" />
|
||||||
|
<style>
|
||||||
|
div.mermaid {
|
||||||
|
/* font-family: 'trebuchet ms', verdana, arial; */
|
||||||
|
font-family: 'Courier New', Courier, monospace !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<h2>External Icons Demo</h2>
|
||||||
|
<pre class="mermaid">
|
||||||
|
architecture-beta
|
||||||
|
service s3(logos:aws-s3)[Cloud Store]
|
||||||
|
service ec2(logos:aws-ec2)[Server]
|
||||||
|
service api(logos:aws-api-gateway)[Api Gateway]
|
||||||
|
</pre>
|
||||||
|
|
||||||
|
<script type="module">
|
||||||
|
import mermaid from './mermaid.esm.mjs';
|
||||||
|
mermaid.initialize({
|
||||||
|
startOnLoad: false,
|
||||||
|
logLevel: 0,
|
||||||
|
});
|
||||||
|
const logos = await fetch('https://unpkg.com/@iconify-json/logos/icons.json');
|
||||||
|
mermaid.registerIconPacks(await logos.json());
|
||||||
|
await mermaid.run();
|
||||||
|
if (window.Cypress) {
|
||||||
|
window.rendered = true;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
Reference in New Issue
Block a user