mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-15 14:29:25 +02:00
added changeset and unit test
This commit is contained in:
5
.changeset/public-things-stare.md
Normal file
5
.changeset/public-things-stare.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'mermaid': major
|
||||||
|
---
|
||||||
|
|
||||||
|
Added support for the click directive in stateDiagram syntax
|
@@ -442,5 +442,22 @@ describe('state diagram V2, ', function () {
|
|||||||
const currentDirection = stateDb.getDirection();
|
const currentDirection = stateDb.getDirection();
|
||||||
expect(currentDirection).toEqual('LR');
|
expect(currentDirection).toEqual('LR');
|
||||||
});
|
});
|
||||||
|
it('should parse and store clickable link with tooltip using the click directive', () => {
|
||||||
|
const diagram = `
|
||||||
|
stateDiagram-v2
|
||||||
|
[*] --> StateA
|
||||||
|
click StateA "https://example.com" "Go to Example"
|
||||||
|
`;
|
||||||
|
|
||||||
|
parser.parse(diagram);
|
||||||
|
|
||||||
|
const links = stateDb.getLinks();
|
||||||
|
|
||||||
|
expect(links.has('StateA')).toBe(true);
|
||||||
|
|
||||||
|
const linkInfo = links.get('StateA');
|
||||||
|
expect(linkInfo.url).toBe('https://example.com');
|
||||||
|
expect(linkInfo.tooltip).toBe('Go to Example');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user