From 65896c4f71e0b3ce09750ccd10e14ee5d5f77885 Mon Sep 17 00:00:00 2001 From: Steven Obiajulu Date: Thu, 17 Sep 2026 15:25:33 -0500 Subject: [PATCH] test(docx-markdoc): bound public ILPA projections individually Two consecutive Node22 CI runs time out while one test aggregates two real ILPA sources and two destination projections under a single thirty-second limit. Register the same four source/destination combinations as individual cases so a slow runner can complete and report each one. Keep every hyperlink, named-style, size and destination-relationship assertion and the thirty-second per-case bound; do not skip inputs, raise timeouts, weaken assertions or change compiler/runtime behavior. The full annotation file now reports twenty-one passing tests instead of eighteen, with each public projection independently accountable. Keep this shipping-blocker repair separate from the focused native cleanup PR. Ref: #982, #993 --- .../src/annotation-roundtrip.test.ts | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/packages/docx-markdoc/src/annotation-roundtrip.test.ts b/packages/docx-markdoc/src/annotation-roundtrip.test.ts index bc285c7a..fc05a3da 100644 --- a/packages/docx-markdoc/src/annotation-roundtrip.test.ts +++ b/packages/docx-markdoc/src/annotation-roundtrip.test.ts @@ -356,27 +356,28 @@ describe('canonical annotation round trips', () => { }); }); - hyperlinkConformance('projects bookmark-stripped real ILPA hyperlinks both ways with valid destination-part relationships', async () => { - const fixtures = [ - '../../../tests/test_documents/redline/ILPA-Model-Limited-Partnership-Agreement-WOF_v2.docx', - '../../../tests/test_documents/redline/ILPA-Model-Limited-Parnership-Agreement-Deal-By-Deal_v1.docx', - ]; - const expectedDestination = 'https://ilpa.org/wp-content/uploads/2017/06/ILPA-Subscription-Lines-of-Credit-and-Alignment-of-Interests-June-2017.pdf'; - const expectedText = expectedDestination; - for (const fixture of fixtures) { - const source = await withoutFootnoteBookmarks(await readFile(new URL(fixture, import.meta.url))); - const imported = await importDocxToMarkdoc(source); - const hyperlinkRun = imported.annotations - .find((annotation) => annotation.id === 'footnote:6')! - .body.flatMap((paragraph) => paragraph.runs) - .find((run) => run.hyperlink); - expect(hyperlinkRun).toMatchObject({ - text: expectedText, - hyperlink: { destination: expectedDestination }, - style: { styleId: 'Hyperlink', fontSizeHalfPoints: 18 }, - }); + // Each full-document projection has its own unchanged 30-second bound. + // Aggregating all four made CI time out before their assertions completed. + for (const [label, fixture] of [ + ['whole-of-fund', '../../../tests/test_documents/redline/ILPA-Model-Limited-Partnership-Agreement-WOF_v2.docx'], + ['deal-by-deal', '../../../tests/test_documents/redline/ILPA-Model-Limited-Parnership-Agreement-Deal-By-Deal_v1.docx'], + ] as const) { + for (const destination of ['comment', 'footnote'] as const) { + hyperlinkConformance('projects bookmark-stripped ' + label + ' ILPA hyperlinks as ' + destination + ' with valid destination-part relationships', async () => { + const expectedDestination = 'https://ilpa.org/wp-content/uploads/2017/06/ILPA-Subscription-Lines-of-Credit-and-Alignment-of-Interests-June-2017.pdf'; + const expectedText = expectedDestination; + const source = await withoutFootnoteBookmarks(await readFile(new URL(fixture, import.meta.url))); + const imported = await importDocxToMarkdoc(source); + const hyperlinkRun = imported.annotations + .find((annotation) => annotation.id === 'footnote:6')! + .body.flatMap((paragraph) => paragraph.runs) + .find((run) => run.hyperlink); + expect(hyperlinkRun).toMatchObject({ + text: expectedText, + hyperlink: { destination: expectedDestination }, + style: { styleId: 'Hyperlink', fontSizeHalfPoints: 18 }, + }); - for (const destination of ['comment', 'footnote'] as const) { const projected = await compileMarkdoc(imported.anchoredSource, projectEveryAnnotationAs(imported.markdoc, destination)); const zip = await JSZip.loadAsync(projected.tracked); const partPath = destination === 'comment' ? 'word/comments.xml' : 'word/footnotes.xml'; @@ -389,9 +390,9 @@ describe('canonical annotation round trips', () => { expect(partXml).toContain(''); expect(partXml).toContain(''); expect(partXml).toContain(expectedText); - } + }, 30_000); } - }, 30_000); + } footnoteConformance('[SDX-MDOC-85] switches profiles and style-only recompiles from one immutable annotation', async () => { const imported = await importDocxToMarkdoc(await sourceWithComment(0, 5));