test: font-embedding regression check (data:-URI + CDN)#4
Merged
Conversation
Guards the two failure modes fixed in #2 so they can't silently return: R1 a woff2 font inlined as a data: URI must be embedded (offline) R2 a CDN font must embed FULL, not a unicode-range subset (network-gated) node:test suite drives the public API (convertHtmlToPptx) end-to-end and asserts on the output .pptx bytes: ppt/fonts non-empty, embeddedFontLst has Regular AND Bold, every embedded EOT's cmap covers Korean, and a byte-size floor rejects the 31 KB subset trap. Zero new dependencies (node:test + jszip + fonteditor-core, all already present). The R1 fixture is a self-contained 5.6 KB HTML deck inlining a ~1.7 KB Pretendard subset (OFL-1.1, attributed in test/fixtures/NOTICE.md), produced by scripts/gen-font-fixture.js. R2 reuses samples/sample.html (Noto Sans KR) and skips loudly when the CDN is unreachable. Runs via `npm run test:fonts`, wired into CI as a dedicated `font-embed` job that launches real Chromium (the fast lint/load matrix stays browser- free). Verified: both cases pass, and neutralizing the data:-URI embed makes R1 fail with "no embedded fonts (ppt/fonts empty)". Includes the full PDCA record (plan/design/analysis/report) for the feature. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2 — a regression guard so the font-embedding failures can't silently return. Full PDCA cycle (plan/design/analysis/report under
docs/).What it checks
Drives the public API (
convertHtmlToPptx) end-to-end and asserts on the output.pptxbytes:ppt/fontsnon-emptyembeddedFontLsthas the family with Regular AND Bold가U+AC00)Two cases
data:font/woff2URI (OFL-1.1, attributed intest/fixtures/NOTICE.md; regenerate viascripts/gen-font-fixture.js).samples/sample.html(Noto Sans KR CDN); skips loudly if the CDN is unreachable, but a real embed failure while online still fails.Wiring
npm run test:fonts(zero new deps —node:test+jszip+fonteditor-core).font-embedlaunches real Chromium; the fast lint/load matrix stays browser-free.Verification
npm test→ 2 pass / 0 fail.data:-URI embed makes R1 fail withno embedded fonts (ppt/fonts empty).