Canvas V2
This commit is contained in:
@@ -209,6 +209,10 @@ func TestCanvasRenderNodes(t *testing.T) {
|
||||
if strings.Contains(link, `href="javascript:`) {
|
||||
t.Errorf("unsafe link rendered:\n%s", link)
|
||||
}
|
||||
named := render(`{"id":"a","type":"link","url":"https://jsoncanvas.org/spec/1.0/","label":"The spec","x":0,"y":0,"width":1,"height":1}`)
|
||||
if !strings.Contains(named, `<span class="truncate">The spec</span><span class="muted truncate">jsoncanvas.org</span>`) || !strings.Contains(named, `title="https://jsoncanvas.org/spec/1.0/"`) {
|
||||
t.Errorf("link with display text:\n%s", named)
|
||||
}
|
||||
group := render(`{"id":"a","type":"group","label":"<b>G</b>","color":"#abc","x":0,"y":0,"width":1,"height":1}`)
|
||||
if !strings.Contains(group, "<b>G</b>") || !strings.Contains(group, "--node-color: #abc") {
|
||||
t.Errorf("group node:\n%s", group)
|
||||
|
||||
Reference in New Issue
Block a user