mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-20 15:59:51 +02:00
Merge pull request #765 from flying-sheep/links
Render nodes as real links
This commit is contained in:
@@ -486,7 +486,7 @@ describe('when parsing ', function () {
|
||||
const vert = flow.parser.yy.getVertices()
|
||||
const edges = flow.parser.yy.getEdges()
|
||||
|
||||
expect(flowDb.setClickEvent).toHaveBeenCalledWith('A', 'callback', undefined, undefined)
|
||||
expect(flowDb.setClickEvent).toHaveBeenCalledWith('A', 'callback', undefined)
|
||||
})
|
||||
|
||||
it('it should be possible to use click to a callback with toolip', function () {
|
||||
@@ -496,26 +496,26 @@ describe('when parsing ', function () {
|
||||
const vert = flow.parser.yy.getVertices()
|
||||
const edges = flow.parser.yy.getEdges()
|
||||
|
||||
expect(flowDb.setClickEvent).toHaveBeenCalledWith('A', 'callback', undefined, 'tooltip')
|
||||
expect(flowDb.setClickEvent).toHaveBeenCalledWith('A', 'callback', 'tooltip')
|
||||
})
|
||||
|
||||
it('should handle interaction - click to a link', function () {
|
||||
spyOn(flowDb, 'setClickEvent')
|
||||
spyOn(flowDb, 'setLink')
|
||||
const res = flow.parser.parse('graph TD\nA-->B\nclick A "click.html"')
|
||||
|
||||
const vert = flow.parser.yy.getVertices()
|
||||
const edges = flow.parser.yy.getEdges()
|
||||
|
||||
expect(flowDb.setClickEvent).toHaveBeenCalledWith('A', undefined, 'click.html', undefined)
|
||||
expect(flowDb.setLink).toHaveBeenCalledWith('A', 'click.html', undefined)
|
||||
})
|
||||
it('should handle interaction - click to a link with tooltip', function () {
|
||||
spyOn(flowDb, 'setClickEvent')
|
||||
spyOn(flowDb, 'setLink')
|
||||
const res = flow.parser.parse('graph TD\nA-->B\nclick A "click.html" "tooltip"')
|
||||
|
||||
const vert = flow.parser.yy.getVertices()
|
||||
const edges = flow.parser.yy.getEdges()
|
||||
|
||||
expect(flowDb.setClickEvent).toHaveBeenCalledWith('A', undefined, 'click.html', 'tooltip')
|
||||
expect(flowDb.setLink).toHaveBeenCalledWith('A', 'click.html', 'tooltip')
|
||||
})
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user