(t *testing.T)
| 123 | } |
| 124 | |
| 125 | func TestExport_TaskDetailJSON(t *testing.T) { |
| 126 | taskDir := createTestTaskDir(t) |
| 127 | outDir := filepath.Join(t.TempDir(), "export") |
| 128 | |
| 129 | err := exportWithMockFS(t, ExportConfig{ |
| 130 | OutputDir: outDir, |
| 131 | ScanDir: taskDir, |
| 132 | BasePath: "/", |
| 133 | Version: "test", |
| 134 | }) |
| 135 | if err != nil { |
| 136 | t.Fatalf("Export failed: %v", err) |
| 137 | } |
| 138 | |
| 139 | data, err := os.ReadFile(filepath.Join(outDir, "api", "tasks", "001.json")) |
| 140 | if err != nil { |
| 141 | t.Fatalf("failed to read task detail: %v", err) |
| 142 | } |
| 143 | |
| 144 | var detail map[string]any |
| 145 | if err := json.Unmarshal(data, &detail); err != nil { |
| 146 | t.Fatalf("invalid JSON in task detail: %v", err) |
| 147 | } |
| 148 | |
| 149 | if detail["id"] != "001" { |
| 150 | t.Errorf("expected id '001', got %v", detail["id"]) |
| 151 | } |
| 152 | |
| 153 | if _, ok := detail["body"]; !ok { |
| 154 | t.Error("expected body field in task detail") |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | func TestExport_BoardJSON(t *testing.T) { |
| 159 | taskDir := createTestTaskDir(t) |
nothing calls this directly
no test coverage detected