From ccee32cb0b1a0feb697b94a74eeb284ad5b491fa Mon Sep 17 00:00:00 2001 From: agent_coder Date: Mon, 6 Jul 2026 06:44:58 +0300 Subject: [PATCH] test(git-sync): assert stable drawio markers, not the omittable center default (#351 review) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit stabilize.test.ts used `data-align="center"` as proof the convergence pass materialized the drawio node. Since this PR correctly stops emitting the schema-default center align in the media builders, that marker is no longer a reliable convergence proof. Assert on the stable canonical markers instead — `data-type="drawio"` + `data-src="/d.drawio"` — which are always materialized regardless of the align default. The fixpoint assertion (file2 === file1) is unchanged; round-trip stays byte-stable. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/git-sync/test/stabilize.test.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/git-sync/test/stabilize.test.ts b/packages/git-sync/test/stabilize.test.ts index d5303e9f..c781546e 100644 --- a/packages/git-sync/test/stabilize.test.ts +++ b/packages/git-sync/test/stabilize.test.ts @@ -55,10 +55,15 @@ describe('stabilizePageFile — normalize-on-write fixpoint (SPEC §11)', () => const file2 = await stabilizePageFile(doc2, meta); expect(file2).toBe(file1); - // The materialized diagram default is present in the stabilized body (proof - // that the convergence pass actually ran, not just that two naive exports - // happened to match). - expect(body1).toContain('data-align="center"'); + // The drawio node was materialized to its canonical HTML form by the + // convergence pass — a bare `{ src }` doc node becomes the full + // `
` — proof the pass actually ran, not + // just two naive exports happening to match. Assert on the stable canonical + // markers rather than `data-align="center"`: center is a schema default the + // converter may omit (see prosemirror-markdown media-html.ts), so it is not + // a reliable convergence proof. + expect(body1).toContain('data-type="drawio"'); + expect(body1).toContain('data-src="/d.drawio"'); }); it('already-stable content is unchanged by the pass (idempotent)', async () => {