improve test coverage

This commit is contained in:
Matthieu MOREL
2020-12-10 12:31:22 +01:00
parent d5d78a1018
commit e7db2a63b9

View File

@@ -739,7 +739,7 @@ foo()
expect(testClass.cssClasses[0]).toBe('clickable'); 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, 'setLink');
spyOn(classDb, 'setTooltip'); spyOn(classDb, 'setTooltip');
const str = 'classDiagram\n' + 'class Class1\n' + 'Class1 : someMethod()\n' + 'click Class1 href "google.com" "A tooltip" _self'; 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'); 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 () { it('should associate link appropriately', function () {
spyOn(classDb, 'setLink'); spyOn(classDb, 'setLink');
spyOn(classDb, 'setTooltip'); spyOn(classDb, 'setTooltip');