From efd6c03aeb352303c823283af3f1fe5d7834a5a3 Mon Sep 17 00:00:00 2001 From: Cuarroc <47299143+Cuarroc@users.noreply.github.com> Date: Thu, 22 Oct 2026 14:02:21 +0200 Subject: [PATCH] test(diagrams): assert the complete fixture SVG export Pin the existing light-theme fixture output with an independent literal.\nCover the exact crop, metadata, paint, geometry and text whitespace while\nretaining the existing focused assertions. No-Test: Test-only missing coverage for already-correct export; baseline and candidate fixture tests pass, so no artificial bug RED. Co-Authored-By: GPT-6.1 --- docs/diagrams/export-svg.test.mjs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/diagrams/export-svg.test.mjs b/docs/diagrams/export-svg.test.mjs index 2fdd77ba..7a355643 100644 --- a/docs/diagrams/export-svg.test.mjs +++ b/docs/diagrams/export-svg.test.mjs @@ -84,6 +84,16 @@ test('export keeps the tspan space and applies tokens and drops the viewer layer const r = spawnSync(process.execPath, [script, 'export', html, out, 'light', 'T', 'D'], { encoding: 'utf8' }); assert.equal(r.status, 0, r.stderr); const svg = readFileSync(out, 'utf8'); + // The rectangle bounds the text, so font metrics do not affect this crop. + const expected = '' + + 'TD' + + '' + + '' + + ' ' + + 'Hello ' + + 'World' + + ''; + assert.equal(svg, expected); assert.ok(svg.includes('>Hello