From fc3c05692febad1904e3ecb6be2148d162517d6c Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Thu, 10 Dec 2020 10:59:34 +0100 Subject: [PATCH] link or click must both work --- src/diagrams/class/classDiagram.spec.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/diagrams/class/classDiagram.spec.js b/src/diagrams/class/classDiagram.spec.js index 088424f34..839a08d39 100644 --- a/src/diagrams/class/classDiagram.spec.js +++ b/src/diagrams/class/classDiagram.spec.js @@ -749,6 +749,15 @@ foo() expect(classDb.setTooltip).toHaveBeenCalledWith('Class1', 'A tooltip'); }); + it('should associate link appropriately', function () { + spyOn(classDb, 'setLink'); + spyOn(classDb, 'setTooltip'); + const str = 'classDiagram\n' + 'class Class1\n' + 'Class1 : someMethod()\n' + 'link Class1 "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 () { spyOn(classDb, 'setClickEvent');