test(docx-core): enable three pre-existing skipped tests#344
Conversation
The suite carried three skips that were placeholders, not genuine engine
gaps. Each is now a real, passing test so the coverage is exercised
rather than silently absent.
field-fragmentation.test.ts — the two edge-case `test.skip`s were empty
bodies deferred to a hypothetical future classifier. Probing the current
engine shows both cases already fragment correctly, so they are now real
scenarios with positive shape assertions (not just "nothing wrapped",
which would also hold if the engine emitted no tracked changes at all):
- Nested IF { PAGE } field replaced by IF { NUMPAGES }: a whole-field
delete+insert (the collapsed-field atom changes), so the test is named
"nested whole-field replacement" and asserts both nested fldChar pairs
survive (12 markers), none inside <w:del>, old PAGE/first content is
delInstrText/delText, and NUMPAGES/second land on the insertion side.
- Separator-less AUTONUM field deleted: asserts the field is begin/end
only (no synthesized `separate`), the instr is wrapped as delInstrText,
and no fldChar lands inside <w:del>.
Both assert tracked changes are actually emitted (anti-vacuity) and that
validateFieldStructure holds on combined/accept/reject. Helpers
(makeNestedField / makeSeparatorlessField / assertEmitsTrackedChanges)
live alongside the existing makeField helper with ECMA-376 17.16.5.1
citations.
DocxArchive.test.ts — "loads and round-trips a real DOCX" was a
hardcoded test.skip needing a word/document.xml-bearing fixture that was
never committed. Rather than add a duplicate binary, it now loads the
existing testing/fixtures/simple-word-change/original.docx, and the dead
ENOENT skip-guard is removed.
Ref: #217
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
LLM-Based Quality GateOverall: ✅ PASS (3 pass · 0 warn · 11 skipped · 14 total)
Full checklist questions
Estimated cost (this run): $0.0046 — 13,498 input + 224 output tokens (≈4 chars/token) on |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
✅ Post-merge smoke passedMerged: Steps
Real-world fixtures
Visual evidence: skipped — this is a test-only enablement PR; no rendered-output change.
Cleanup
|
What
Turns three long-standing
test.skips indocx-coreinto real, passing tests. After this changedocx-corereports 0 skipped (1350 passing). None of these were genuine engine gaps — they were placeholders.1 & 2 —
field-fragmentation.test.tsedge casesTwo empty
test.skipbodies deferred to a hypothetical "future classifier." The current engine already fragments both cases correctly, so they are now real scenarios with positive shape assertions (not just "nothing wrapped", which would also hold if the engine emitted no tracked changes):IF { PAGE } …→IF { NUMPAGES } …): because the collapsed-field atom changes, the engine emits a whole-field delete + insert (renamed accordingly so readers don't infer surgical inner-only correlation). Asserts both nested fldChar pairs survive (12 markers), none inside<w:del>, oldPAGE/firstcontent isdelInstrText/delText, andNUMPAGES/secondland on the insertion side.AUTONUM, noseparatemarker): asserts the field staysbegin/endonly (no synthesizedseparate), the instr is wrapped asdelInstrText, and no fldChar lands inside<w:del>.Both assert tracked changes are actually emitted (anti-vacuity) and that
validateFieldStructureholds on combined/accept/reject.3 —
DocxArchive.test.tsround-trip"loads and round-trips a real DOCX" was a hardcoded
test.skipneeding a fixture that was never committed. Rather than add a duplicate binary, it now loads the existingtesting/fixtures/simple-word-change/original.docx, and the dead ENOENT skip-guard is removed.Testing
npx vitest runon both files: 17 passed, 0 skippedbuild,lint:workspaces(0 errors),test:run(docx-core 1350 passed),check:spec-coverage,check:conformance-citations,check:conformance-doc<w:del>/<w:ins>/<w:fldChar>teeth); its three findings (vacuity guards, nested-test naming, duplicate fixture) are all addressed here.Ref: #217