diff --git a/src/diagrams/class/classDiagram.spec.js b/src/diagrams/class/classDiagram.spec.js index 839a08d39..baaa9ca65 100644 --- a/src/diagrams/class/classDiagram.spec.js +++ b/src/diagrams/class/classDiagram.spec.js @@ -739,7 +739,7 @@ foo() expect(testClass.cssClasses[0]).toBe('clickable'); }); - it('should associate click and href link appropriately', function () { + it('should associate click and href link with tooltip and target 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'; @@ -749,6 +749,22 @@ foo() expect(classDb.setTooltip).toHaveBeenCalledWith('Class1', 'A tooltip'); }); + it('should associate click and href link appropriately', function () { + spyOn(classDb, 'setLink'); + const str = 'classDiagram\n' + 'class Class1\n' + 'Class1 : someMethod()\n' + 'click Class1 href "google.com"'; + parser.parse(str); + + expect(classDb.setLink).toHaveBeenCalledWith('Class1', 'google.com'); + }); + + it('should associate click and href link with target appropriately', function () { + spyOn(classDb, 'setLink'); + const str = 'classDiagram\n' + 'class Class1\n' + 'Class1 : someMethod()\n' + 'click Class1 href "google.com" _self'; + parser.parse(str); + + expect(classDb.setLink).toHaveBeenCalledWith('Class1', 'google.com', '_self'); + }); + it('should associate link appropriately', function () { spyOn(classDb, 'setLink'); spyOn(classDb, 'setTooltip');