From c680071a5683e39c5794da574b1c63f5cc1ddd5c Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Sun, 24 Nov 2024 09:57:06 -0800 Subject: [PATCH] fix d2sequence tests --- d2layouts/d2sequence/layout_test.go | 9 +- .../TestCLI_E2E/vars-animation.exp.svg | 180 +++++++++--------- 2 files changed, 95 insertions(+), 94 deletions(-) diff --git a/d2layouts/d2sequence/layout_test.go b/d2layouts/d2sequence/layout_test.go index 37c62a017..08d8c6e5f 100644 --- a/d2layouts/d2sequence/layout_test.go +++ b/d2layouts/d2sequence/layout_test.go @@ -7,6 +7,7 @@ import ( "github.com/stretchr/testify/assert" + "oss.terrastruct.com/d2/d2ast" "oss.terrastruct.com/d2/d2compiler" "oss.terrastruct.com/d2/d2graph" "oss.terrastruct.com/d2/d2layouts/d2sequence" @@ -321,7 +322,7 @@ container -> c: edge 1 assert.True(t, has) b_t1.Box = geo.NewBox(nil, 100, 100) - c := g.Root.EnsureChild([]string{"c"}) + c := g.Root.EnsureChild([]d2ast.String{d2ast.FlatUnquotedString("c")}) c.Box = geo.NewBox(nil, 100, 100) c.Shape = d2graph.Scalar{Value: d2target.ShapeSquare} @@ -379,7 +380,7 @@ container -> c: edge 1 func TestSelfEdges(t *testing.T) { g := d2graph.NewGraph() g.Root.Shape = d2graph.Scalar{Value: d2target.ShapeSequenceDiagram} - n1 := g.Root.EnsureChild([]string{"n1"}) + n1 := g.Root.EnsureChild([]d2ast.String{d2ast.FlatUnquotedString("n1")}) n1.Box = geo.NewBox(nil, 100, 100) g.Edges = []*d2graph.Edge{ @@ -415,12 +416,12 @@ func TestSelfEdges(t *testing.T) { func TestSequenceToDescendant(t *testing.T) { g := d2graph.NewGraph() g.Root.Shape = d2graph.Scalar{Value: d2target.ShapeSequenceDiagram} - a := g.Root.EnsureChild([]string{"a"}) + a := g.Root.EnsureChild([]d2ast.String{d2ast.FlatUnquotedString("a")}) a.Box = geo.NewBox(nil, 100, 100) a.Attributes = d2graph.Attributes{ Shape: d2graph.Scalar{Value: shape.PERSON_TYPE}, } - a_t1 := a.EnsureChild([]string{"t1"}) + a_t1 := a.EnsureChild([]d2ast.String{d2ast.FlatUnquotedString("t1")}) a_t1.Box = geo.NewBox(nil, 16, 80) g.Edges = []*d2graph.Edge{ diff --git a/e2etests-cli/testdata/TestCLI_E2E/vars-animation.exp.svg b/e2etests-cli/testdata/TestCLI_E2E/vars-animation.exp.svg index 67a938e4d..e0f86221d 100644 --- a/e2etests-cli/testdata/TestCLI_E2E/vars-animation.exp.svg +++ b/e2etests-cli/testdata/TestCLI_E2E/vars-animation.exp.svg @@ -1,16 +1,16 @@ CHICKEN'S PLAN +}]]>CHICKEN'S PLAN -CHICKEN'S PLANAPPROACH ROAD +CHICKEN'S PLANAPPROACH ROAD -CHICKEN'S PLANAPPROACH ROADCROSS ROAD +CHICKEN'S PLANAPPROACH ROADCROSS ROAD -CHICKEN'S PLANAPPROACH ROADCROSS ROADMAKE YOU WONDER WHY +CHICKEN'S PLANAPPROACH ROADCROSS ROADMAKE YOU WONDER WHY