Skip to content

Commit 169d125

Browse files
authored
Merge pull request #163 from mermaid-js/fix/self-async-positioning2
Fix/self async positioning2
2 parents ad07d0e + 5e3c936 commit 169d125

23 files changed

+260
-89
lines changed

cy/async-message-1.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
7+
<title>Self Sync Message at Root</title>
8+
<style>
9+
body {
10+
margin: 0; /* mostly for demo on mobile */
11+
}
12+
</style>
13+
</head>
14+
<body>
15+
<div id="diagram" class="diagram">
16+
<pre class="zenuml" style="margin: 0">
17+
A->A: async
18+
A->B: async
19+
A->C: async
20+
B->B: async
21+
B->C: async
22+
B->A: async
23+
C->C: async
24+
C->B: async
25+
C->A: async
26+
</pre>
27+
</div>
28+
29+
<!-- built files will be auto injected -->
30+
<script type="module" src="/src/main-cy.ts"></script>
31+
</body>
32+
</html>

cy/async-message-2.html

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
7+
<title>Self Sync Message at Root</title>
8+
<style>
9+
body {
10+
margin: 0; /* mostly for demo on mobile */
11+
}
12+
</style>
13+
</head>
14+
<body>
15+
<div id="diagram" class="diagram">
16+
<pre class="zenuml" style="margin: 0">
17+
A.method {
18+
A->A: async
19+
A->B: async
20+
A->C: async
21+
B->B: async
22+
B->C: async
23+
B->A: async
24+
C->C: async
25+
C->B: async
26+
C->A: async
27+
B.method {
28+
A->A: async
29+
A->B: async
30+
A->C: async
31+
B->B: async
32+
B->C: async
33+
B->A: async
34+
C->C: async
35+
C->B: async
36+
C->A: async
37+
}
38+
}
39+
40+
</pre>
41+
</div>
42+
43+
<!-- built files will be auto injected -->
44+
<script type="module" src="/src/main-cy.ts"></script>
45+
</body>
46+
</html>

cy/async-message-3.html

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
7+
<title>Self Sync Message at Root</title>
8+
<style>
9+
body {
10+
margin: 0; /* mostly for demo on mobile */
11+
}
12+
</style>
13+
</head>
14+
<body>
15+
<div id="diagram" class="diagram">
16+
<pre class="zenuml" style="margin: 0">
17+
A B C
18+
C.method {
19+
A->C: async
20+
C->A: async
21+
C->B: async
22+
B->C: async
23+
B.method {
24+
A->A: async
25+
A->B: async
26+
A->C: async
27+
B->B: async
28+
B->C: async
29+
B->A: async
30+
C->C: async
31+
C->B: async
32+
C->A: async
33+
}
34+
}
35+
</pre>
36+
</div>
37+
38+
<!-- built files will be auto injected -->
39+
<script type="module" src="/src/main-cy.ts"></script>
40+
</body>
41+
</html>
26 KB
Loading
42.6 KB
Loading
34 KB
Loading
-524 Bytes
Loading
-1.8 KB
Loading

cypress/e2e/async-message.spec.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* eslint-disable no-undef */
2+
import "cypress-plugin-snapshots/commands";
3+
describe("Rendering", function () {
4+
it("Async message - 1", function () {
5+
cy.visit("http://127.0.0.1:8080/cy/async-message-1.html");
6+
// This line is to make sure the privacy icon is loaded
7+
cy.get(".privacy>span>svg", { timeout: 5000 }).should("be.visible");
8+
cy.document().toMatchImageSnapshot({
9+
imageConfig: { threshold: 0.01 },
10+
capture: "viewport",
11+
});
12+
});
13+
it("Async message - 2", function () {
14+
cy.visit("http://127.0.0.1:8080/cy/async-message-2.html");
15+
// This line is to make sure the privacy icon is loaded
16+
cy.get(".privacy>span>svg", { timeout: 5000 }).should("be.visible");
17+
cy.document().toMatchImageSnapshot({
18+
imageConfig: { threshold: 0.01 },
19+
capture: "viewport",
20+
});
21+
});
22+
it("Async message - 3", function () {
23+
cy.visit("http://127.0.0.1:8080/cy/async-message-3.html");
24+
// This line is to make sure the privacy icon is loaded
25+
cy.get(".privacy>span>svg", { timeout: 5000 }).should("be.visible");
26+
cy.document().toMatchImageSnapshot({
27+
imageConfig: { threshold: 0.01 },
28+
capture: "viewport",
29+
});
30+
});
31+
});

cypress/e2e/creation.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/* eslint-disable no-undef */
2-
import 'cypress-plugin-snapshots/commands';
3-
describe('Smoke test', function () {
4-
it('creation', function () {
5-
cy.visit('http://127.0.0.1:8080/cy/smoke-creation.html');
2+
import "cypress-plugin-snapshots/commands";
3+
describe("Smoke test", function () {
4+
it("creation", function () {
5+
cy.visit("http://127.0.0.1:8080/cy/smoke-creation.html");
66
// This line is to make sure the privacy icon is loaded
7-
cy.get('.privacy>span>svg', { timeout: 5000 }).should('be.visible');
7+
cy.get(".privacy>span>svg", { timeout: 5000 }).should("be.visible");
88
cy.document().toMatchImageSnapshot({
99
imageConfig: { threshold: 0.01 },
10-
capture: 'viewport',
10+
capture: "viewport",
1111
});
1212
});
1313
});

0 commit comments

Comments
 (0)