diff --git a/d2oracle/edit_test.go b/d2oracle/edit_test.go index 0c51d26da..39e7888ff 100644 --- a/d2oracle/edit_test.go +++ b/d2oracle/edit_test.go @@ -30,6 +30,7 @@ func TestCreate(t *testing.T) { boardPath []string name string text string + fsTexts map[string]string key string expKey string @@ -799,6 +800,38 @@ steps: { exp: `a d +steps: { + x: { + b + d 2 + } +} +`, + }, + { + name: "image-edge", + + text: `...@k +a.b: { + icon: https://icons.terrastruct.com/essentials/004-picture.svg + shape: image +} +`, + fsTexts: map[string]string{ + "k.d2": ` +a: { + b + c +} +`, + }, + key: `a.b -> a.c`, + boardPath: []string{}, + + expKey: `d 2`, + exp: `a +d + steps: { x: { b @@ -816,7 +849,8 @@ steps: { var newKey string et := editTest{ - text: tc.text, + text: tc.text, + fsTexts: tc.fsTexts, testFunc: func(g *d2graph.Graph) (*d2graph.Graph, error) { var err error g, newKey, err = d2oracle.Create(g, tc.boardPath, tc.key)