This commit is contained in:
Alexander Wang 2025-03-25 10:44:47 -06:00
parent b7b58c5921
commit 4d136e0946
No known key found for this signature in database
GPG key ID: BE3937D0D52D8927

View file

@ -30,6 +30,7 @@ func TestCreate(t *testing.T) {
boardPath []string boardPath []string
name string name string
text string text string
fsTexts map[string]string
key string key string
expKey string expKey string
@ -799,6 +800,38 @@ steps: {
exp: `a exp: `a
d 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: { steps: {
x: { x: {
b b
@ -816,7 +849,8 @@ steps: {
var newKey string var newKey string
et := editTest{ et := editTest{
text: tc.text, text: tc.text,
fsTexts: tc.fsTexts,
testFunc: func(g *d2graph.Graph) (*d2graph.Graph, error) { testFunc: func(g *d2graph.Graph) (*d2graph.Graph, error) {
var err error var err error
g, newKey, err = d2oracle.Create(g, tc.boardPath, tc.key) g, newKey, err = d2oracle.Create(g, tc.boardPath, tc.key)