mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-20 15:59:51 +02:00
test link target
This commit is contained in:
@@ -739,6 +739,17 @@ foo()
|
|||||||
expect(testClass.cssClasses[0]).toBe('clickable');
|
expect(testClass.cssClasses[0]).toBe('clickable');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should associate click and href link appropriately', function () {
|
||||||
|
spyOn(classDb, 'setLink');
|
||||||
|
spyOn(classDb, 'setTooltip');
|
||||||
|
const str = 'classDiagram\n' + 'class Class1\n' + 'Class1 : someMethod()\n' + 'click Class1 href "google.com" "A tooltip" _self';
|
||||||
|
parser.parse(str);
|
||||||
|
|
||||||
|
expect(classDb.setLink).toHaveBeenCalledWith('Class1', 'google.com', '_self');
|
||||||
|
expect(classDb.setTooltip).toHaveBeenCalledWith('Class1', 'A tooltip');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
it('should associate callback appropriately', function () {
|
it('should associate callback appropriately', function () {
|
||||||
spyOn(classDb, 'setClickEvent');
|
spyOn(classDb, 'setClickEvent');
|
||||||
const str = 'classDiagram\n' + 'class Class1\n' + 'Class1 : someMethod()\n' + 'callback Class1 "functionCall"';
|
const str = 'classDiagram\n' + 'class Class1\n' + 'Class1 : someMethod()\n' + 'callback Class1 "functionCall"';
|
||||||
|
Reference in New Issue
Block a user