diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-24 22:44:07 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-24 22:44:07 +0200 |
| commit | 6a761bac0d866f2f3a3b224b603446630803e362 (patch) | |
| tree | 83d6b16788d2494949480fed66b885bcd5e744a8 /internal/flamegraph/svgwriter_test.go | |
| parent | cf65e3f93e0565dda8f124b21b2c44b3a3ecaff5 (diff) | |
Make flamegraph SVG width responsive
Diffstat (limited to 'internal/flamegraph/svgwriter_test.go')
| -rw-r--r-- | internal/flamegraph/svgwriter_test.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/flamegraph/svgwriter_test.go b/internal/flamegraph/svgwriter_test.go index 6fdbe3d..56f2c20 100644 --- a/internal/flamegraph/svgwriter_test.go +++ b/internal/flamegraph/svgwriter_test.go @@ -100,8 +100,11 @@ func TestWriteSVGInvalidConfigFallsBack(t *testing.T) { cfg := SVGConfig{Title: "x", Width: 0, FrameHeight: 0, FontSize: 0, MinWidthPx: 0} svg := renderSVGForTest(t, tr, cfg) - if !strings.Contains(svg, `width="1200"`) { - t.Fatalf("expected fallback width, got: %s", svg) + if !strings.Contains(svg, `width="100%"`) { + t.Fatalf("expected responsive svg width, got: %s", svg) + } + if !strings.Contains(svg, `viewBox="0 0 1200 `) { + t.Fatalf("expected fallback viewBox width, got: %s", svg) } if !strings.Contains(svg, "I/O Flame Graph") { t.Fatalf("expected fallback title, got: %s", svg) |
