From 0e40d8e8a80e79ff3ba438acbb329973fccde125 Mon Sep 17 00:00:00 2001 From: omkarht Date: Mon, 28 Jul 2025 15:55:07 +0530 Subject: [PATCH] fix: fixed failing test cases on-behalf-of: @Mermaid-Chart --- .../diagrams/sequence/sequenceDiagram.spec.js | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js b/packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js index c3b8c2b4a..776201f62 100644 --- a/packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js +++ b/packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js @@ -104,6 +104,7 @@ describe('more than one sequence diagram', () => { [ { "activate": false, + "centralConnection": 0, "from": "Alice", "id": "0", "message": "Hello Bob, how are you?", @@ -113,6 +114,7 @@ describe('more than one sequence diagram', () => { }, { "activate": false, + "centralConnection": 0, "from": "Bob", "id": "1", "message": "I am good thanks!", @@ -131,6 +133,7 @@ describe('more than one sequence diagram', () => { [ { "activate": false, + "centralConnection": 0, "from": "Alice", "id": "0", "message": "Hello Bob, how are you?", @@ -140,6 +143,7 @@ describe('more than one sequence diagram', () => { }, { "activate": false, + "centralConnection": 0, "from": "Bob", "id": "1", "message": "I am good thanks!", @@ -160,6 +164,7 @@ describe('more than one sequence diagram', () => { [ { "activate": false, + "centralConnection": 0, "from": "Alice", "id": "0", "message": "Hello John, how are you?", @@ -169,6 +174,7 @@ describe('more than one sequence diagram', () => { }, { "activate": false, + "centralConnection": 0, "from": "John", "id": "1", "message": "I am good thanks!", @@ -2038,4 +2044,34 @@ Bob->>Alice:Got it! expect(messages[0].from).toBe('Alice'); expect(messages[0].to).toBe('Bob'); }); + + it('1 should parse ', async () => { + const diagram = await Diagram.fromText(` + sequenceDiagram + actor Bob + actor Alice + Bob -|\\ Alice: Hello Alice, how are you? + Bob -|/ Alice: Hello Alice, how are you? + Bob -// Alice: Hello Alice, how are you? + Bob -\\\\ Alice: Hello Alice, how are you? + + Bob \\|- Alice: Hello Alice, how are you? + Bob /|- Alice: Hello Alice, how are you? + Bob //- Alice: Hello Alice, how are you? + Bob \\\\- Alice: Hello Alice, how are you? + `); + + const messages = diagram.db.getMessages(); + }); + + it('2 should parse ', async () => { + const diagram = await Diagram.fromText(` + sequenceDiagram + actor Bob + actor Alice + Alice ()<<->>() Bob: hey? + `); + + const messages = diagram.db.getMessages(); + }); });