(t *testing.T)
| 258 | } |
| 259 | |
| 260 | func TestExport_IndexHTML_BasePath(t *testing.T) { |
| 261 | taskDir := createTestTaskDir(t) |
| 262 | outDir := filepath.Join(t.TempDir(), "export") |
| 263 | |
| 264 | err := exportWithMockFS(t, ExportConfig{ |
| 265 | OutputDir: outDir, |
| 266 | ScanDir: taskDir, |
| 267 | BasePath: "/demo/", |
| 268 | Version: "test", |
| 269 | }) |
| 270 | if err != nil { |
| 271 | t.Fatalf("Export failed: %v", err) |
| 272 | } |
| 273 | |
| 274 | data, err := os.ReadFile(filepath.Join(outDir, "index.html")) |
| 275 | if err != nil { |
| 276 | t.Fatalf("failed to read index.html: %v", err) |
| 277 | } |
| 278 | |
| 279 | html := string(data) |
| 280 | |
| 281 | if !strings.Contains(html, `<base href="/demo/">`) { |
| 282 | t.Error("expected <base> tag with /demo/ in index.html") |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | func TestExport_IndexHTML_BasePathRoot(t *testing.T) { |
| 287 | taskDir := createTestTaskDir(t) |
nothing calls this directly
no test coverage detected