mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-10 02:49:40 +02:00
Updated test
This commit is contained in:
@@ -6,7 +6,7 @@ describe('Sequencediagram', () => {
|
|||||||
cy.visit(url);
|
cy.visit(url);
|
||||||
cy.get('body')
|
cy.get('body')
|
||||||
.find('svg')
|
.find('svg')
|
||||||
.should('have.length', 2);
|
.should('have.length', 1);
|
||||||
});
|
});
|
||||||
it('should handle html escapings properly', () => {
|
it('should handle html escapings properly', () => {
|
||||||
const url = 'http://localhost:9000/webpackUsage.html?test-html-escaping=true';
|
const url = 'http://localhost:9000/webpackUsage.html?test-html-escaping=true';
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import mermaid from '../../dist/mermaid.core'
|
import mermaid from '../../dist/mermaid.core';
|
||||||
|
|
||||||
let code = `flowchart LR
|
let code = `flowchart LR
|
||||||
Power_Supply --> Transmitter_A
|
Power_Supply --> Transmitter_A
|
||||||
@@ -22,21 +22,19 @@ let code2 = `gantt
|
|||||||
Create tests for renderer :2d
|
Create tests for renderer :2d
|
||||||
Add to mermaid :1d`;
|
Add to mermaid :1d`;
|
||||||
|
|
||||||
|
const code3 = `flowchart TD
|
||||||
const code3 = `graph TD
|
|
||||||
A(<img scr='https://iconscout.com/ms-icon-310x310.png' width='20' height='20' />)
|
A(<img scr='https://iconscout.com/ms-icon-310x310.png' width='20' height='20' />)
|
||||||
B(<b>Bold text</b>)`;
|
B(<b>Bold text!</b>)`;
|
||||||
|
|
||||||
|
if (location.href.match('test-html-escaping')) {
|
||||||
if(location.href.match('test-html-escaping')){
|
|
||||||
code = code3;
|
code = code3;
|
||||||
}
|
}
|
||||||
|
|
||||||
mermaid.initialize({
|
mermaid.initialize({
|
||||||
theme: 'default',
|
theme: 'default',
|
||||||
fontFamily: '"Lucida Console", Monaco, monospace',
|
// fontFamily: '"Lucida Console", Monaco, monospace',
|
||||||
startOnLoad: false,
|
startOnLoad: false,
|
||||||
securityLevel: "loose",
|
securityLevel: 'loose',
|
||||||
flowchart: {
|
flowchart: {
|
||||||
htmlLabels: true
|
htmlLabels: true
|
||||||
},
|
},
|
||||||
|
@@ -1,22 +1,17 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
|
<head>
|
||||||
|
<style>
|
||||||
|
/* .mermaid {
|
||||||
|
font-family: "trebuchet ms", verdana, arial;;
|
||||||
|
} */
|
||||||
|
/* .mermaid {
|
||||||
|
font-family: 'arial';
|
||||||
|
} */
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="mermaid">
|
<div id="graph-to-be"></div>
|
||||||
graph LR
|
|
||||||
A-->B
|
|
||||||
</div>
|
|
||||||
<div class="mermaid">
|
|
||||||
gantt
|
|
||||||
title A Gantt Diagram
|
|
||||||
dateFormat YYYY-MM-DD
|
|
||||||
section Section
|
|
||||||
A task :a1, 2014-01-01, 30d
|
|
||||||
Another task :after a1 , 20d
|
|
||||||
section Another
|
|
||||||
Task in sec :2014-01-12 , 12d
|
|
||||||
another task : 24d
|
|
||||||
</div>
|
|
||||||
<script src="./bundle-test.js" charset="utf-8"></script>
|
<script src="./bundle-test.js" charset="utf-8"></script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user