Skip to content

fix(website): assert served favicons, not hand-written layout markup - #1381

Merged
vivek7405 merged 1 commit into
mainfrom
fix/website-seo-infra-icons
Aug 10, 2026
Merged

fix(website): assert served favicons, not hand-written layout markup#1381
vivek7405 merged 1 commit into
mainfrom
fix/website-seo-infra-icons

Conversation

@vivek7405

Copy link
Copy Markdown
Collaborator

Closes #1380

main is red on In-repo app tests (website + blog + gallery). That job passed on 7867caee and fails on e0622b59 (#1379), so the regression is mine.

#1379 moved the website's favicons onto metadata.icons and updated the repo-health copy of these assertions, but the website carries its own copy in its own suite, and I missed it. That copy renders RootLayout(...) alone and regexes the output for the markup, so it cannot see icons the framework splices into <head>. The tags are served correctly; only the test's way of looking for them was stale.

✖ the declared favicon size matches the real asset and clears Google 48px floor
✖ the apple-touch icon points at a correctly sized asset
✖ the raster icon is declared before the SVG

Fix

Read the SERVED page instead, matching what test/repo-health/site-seo-tags.test.mjs was changed to in #1379. That is the more honest assertion regardless: a favicon can arrive from hand-written markup, from metadata.icons, or from an auto-linked app/icon.* route, and a browser cannot tell the difference, so neither should the test.

Attribute matching is now order-independent. The framework emits rel, href, sizes, type while the hand-written markup used rel, href, type, sizes, which was a second reason the regexes broke.

Also adds the resolve check the repo-health copy grew at the same time: every icon href in the head is fetched and asserted 200. A head naming a dead URL is invisible from the app and only shows as a missing tab mark, which is how this class of defect reached production on gallery.webjs.dev (#1375, #1377).

Left alone deliberately: the canonical tests still assert how the value is DERIVED across URL variants (one rendered page cannot show that), and the favicon.ico check stays a filesystem assertion since nothing links it on purpose.

Verification

( cd website && node scripts/copy-registry.mjs && npx webjs test )471/471, matching the CI job's count. webjs check and webjs typecheck clean.

Worth recording, because it cost me a wrong read first: running the website suite in a fresh worktree without node scripts/copy-registry.mjs fails 9 unrelated UI-gallery tests and ~37 typecheck errors, since that step generates the gitignored modules/ui/components/** and lib/utils/cn.ts. The issue body carries this note for the next person.

Not in scope

These SEO invariants are asserted in two files, which is why #1379 could update one and leave the other red. Collapsing them is a separate call, flagged in #1380 rather than folded in here.

#1379 moved the website's icons onto metadata.icons and updated the
repo-health copy of these assertions, but missed this one: the website
carries its OWN copy in its own suite, and it regexed the markup that
`renderToString(RootLayout(...))` produces. The icons are spliced into
<head> by the framework now, so a bare layout render cannot see them and
three assertions went red on main.

Read the SERVED page instead. That is the more honest assertion anyway:
the tags may come from hand-written markup, from metadata.icons, or from
an auto-linked app/icon.* route, and a browser cannot tell the
difference, so neither should the test.

Add the resolve check the repo-health copy grew at the same time, so a
head naming a URL nothing answers fails here rather than as a missing
tab mark in production.
@vivek7405
vivek7405 merged commit 034d6a0 into main Aug 10, 2026
7 of 10 checks passed
@vivek7405
vivek7405 deleted the fix/website-seo-infra-icons branch August 10, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: seo-infra test asserts icon markup that metadata.icons replaced

1 participant