MCPcopy Create free account
hub / github.com/driangle/taskmd / TestToMermaid

Function TestToMermaid

sdk/go/graph/graph_test.go:185–223  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

183}
184
185func TestToMermaid(t *testing.T) {
186 tasks := []*model.Task{
187 {
188 ID: "T1",
189 Title: "Task 1",
190 Status: model.StatusCompleted,
191 Dependencies: []string{},
192 },
193 {
194 ID: "T2",
195 Title: "Task 2",
196 Status: model.StatusPending,
197 Dependencies: []string{"T1"},
198 },
199 }
200
201 g := NewGraph(tasks)
202 output := g.ToMermaid("T2")
203
204 if !strings.Contains(output, "graph TD") {
205 t.Error("Expected mermaid output to contain 'graph TD'")
206 }
207
208 if !strings.Contains(output, "T1") {
209 t.Error("Expected mermaid output to contain T1")
210 }
211
212 if !strings.Contains(output, "T2") {
213 t.Error("Expected mermaid output to contain T2")
214 }
215
216 if !strings.Contains(output, "T1 --> T2") {
217 t.Error("Expected mermaid output to contain edge T1 --> T2")
218 }
219
220 if !strings.Contains(output, ":::focus") {
221 t.Error("Expected mermaid output to highlight focus task")
222 }
223}
224
225func TestToDot(t *testing.T) {
226 tasks := []*model.Task{

Callers

nothing calls this directly

Calls 3

ToMermaidMethod · 0.95
NewGraphFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected