Repository navigation
test(site): check each page's metadata and the translator - #278
Merged
juancguerrerodev merged 5 commits intoDec 6, 2026
Merged
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Contributor
|
Thanks! A small ask for the next ones: the issues say to take one at a time, so newcomers joining this week find some left. 🦀 |
juancguerrerodev
force-pushed
the
test/site-page-metadata
branch
from
December 6, 2026 09:10
8ca98ec to
c5dccaa
Compare
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.
What and why
Closes #267
Adds
apps/site/test/meta.test.ts(Vitest, like the other files inapps/site/test): unit tests forpageMetadataandchooserMetadatainapps/site/lib/meta.ts, for theOG_IMAGElink preview, and for thetranslator/isLanghelpers inapps/site/lib/i18n.ts. Tests only:apps/site/liband the locale files are unchanged, and the metadata is checked againsttranslatoroutput rather than hard-coded copy, so a copy change doesn't break the tests.What the tests cover:
LANGSand each page (HM-SITE-01with"",HM-SITE-02with"privacy/",HM-SITE-03with"download/"): title and description fromtranslator(lang), the canonical addresshref(lang, page), thees-419/enalternates pointing at the same page plusx-defaultat/, the Open Graph locale (en_US/es_LA) with the other language as the alternate locale, one preview image withOG_IMAGE's address, width and height and thecommon.ogAlttext, the same image in Open Graph and in the Twitter card, andmetadataBaseonSITE_URL.chooserMetadata: the canonical address/, the same alternates as the home page, and Spanish as the Open Graph locale.OG_IMAGE.urlis/brand/followed by one of the files inBRAND_FILES.translator: a missing key throws with the key and the language in the message; a placeholder with no value throws with the placeholder named;isLangaccepts only"es"and"en", not"es-419"or"EN".Vision fit
A site that says what is true today, with contributor tools that work: the metadata behind every page's title, canonical address, language alternates and link preview is now checked in seconds by a unit test, without a build and without reading the exported HTML by hand.
Non-negotiables
Checklist
acceptedproposal.pnpm check:privacy,pnpm typecheck,pnpm lint,pnpm testandnode scripts/guard/check.mjs --patterns scripts/guard/patterns.txt.packages/copy, in es-419 and en, with matching keys and placeholders, and no em or en dashes.On the gates: this is a test-only change to
apps/site, and I could not run the whole workspace's gates on this machine (the disk is nearly full, so a fullpnpm installof every workspace package was not possible; the install was filtered to the root workspace and@hermit/site). What I did run, exactly:pnpm install --filter . --filter @hermit/site(filtered workspace install; lockfile untouched)pnpm --filter @hermit/site test— 11 files, 84 tests, all passing, including the newtest/meta.test.ts(11 tests)pnpm --filter @hermit/site test test/meta.test.ts— the new file alone, passingpnpm --filter @hermit/site typecheck— cleanpnpm exec eslint apps/site/test/meta.test.ts— cleannode scripts/check-privacy.mjs— "privacy: no analytics, crash reporting or login brokers found"node scripts/guard/check.mjs --patterns scripts/guard/patterns.txt— "guard: ok"Each expectation was broken on purpose to watch it fail before being put back: swapping the Open Graph locale expectation failed all six page tests; a wrong canonical for the chooser, a brand file not in
BRAND_FILES, wrong error-message patterns fortranslator, andisLang("EN")expected true each failed exactly their own test. What I did not run: the full-workspacepnpm typecheck,pnpm lintandpnpm testfor the other packages, which this change doesn't touch (it adds one file underapps/site/testand edits nothing else).Model path
packages/model,agent,skillsoreval, the prompt, the router, tool descriptions, normalizers, examples or the model file.Screenshots
New dependencies and network calls
n/a
AI agents
lib/meta.ts,lib/i18n.tsand the neighbouring tests, ran it, broke each expectation to watch it fail, and put it back. The claim comment on the issue was posted from the mir-ashiq account this branch is pushed from.