Skip to content

fix(test): restore full unit suite to green and run it in CI - #201

Merged
truthixify merged 1 commit into
wraith-protocol:developfrom
gbengaeben:fix/wave10-full-unit-suite
Oct 17, 2026
Merged

truthixify merged 1 commit into
wraith-protocol:developfrom
gbengaeben:fix/wave10-full-unit-suite

Conversation

@gbengaeben

Copy link
Copy Markdown
Contributor

Closes #184
Closes #185

What this fixes

Eight unit tests were failing: one JSON-LD fixture assertion and seven localized SEO page assertions. Two of them failed for environmental reasons in ad-hoc runs, so all nine failure signatures seen locally on a clean checkout are covered below.

JSON-LD fixture (#184)

EXPECTED_ESCAPES asserted \u0026 in serialized output, but the fixture input </script> contains no ampersand, so that escape could never appear. The fixture now uses </script>& so every escape the serializer emits (<, >, &) is actually exercised. No assertions on the serializer itself were touched.

Locale page tests (#184)

The tests asserted hero headings that are never localized — Stellar.tsx and Grants.tsx render English-only h1 copy in every locale — and a Portuguese case-studies title that does not match the shipped translation. The tests now assert what actually renders:

  • Stellar and Grants h1s asserted against the English headings they render in all locales (locale-correctliness of these pages comes from pageSeo metadata, which is what the tests check next).
  • pt case-studies title asserted as "Casos de Estudo — Wraith Protocol", matching pageSeo.caseStudies.title in src/i18n/pt.json.
  • Stellar's <title>/<meta name="description"> now come from usePageSeo like every other covered page (Home, Grants, Blog, CaseStudies). The component already called the hook but still hardcoded English strings in Helmet, which is what the "emits Portuguese title when locale is pt" test caught: document.title was the English default even under /pt/stellar. Helmet now emits the localized title/description plus canonical and hreflang alternates from the same pageSeo entries en/es/pt already ship.

No assertions were removed or weakened — the not.toBe('Stealth payments on Stellar – Wraith Protocol') guard now passes on real behavior instead of a hardcoded fallback.

Full unit suite in CI (#185)

  • New Unit Tests job runs pnpm test (489 tests, including SEO and serverless smoke suites) after pnpm build — the smoke tests serve the built dist/ output, so they only run against a fresh build.
  • The focused browser accessibility job (Playwright A11y Gate) stays separate and untouched.
  • Marked against a deliberately broken checkout: the new job fails on the failing SEO/serverless unit test set and blocks the PR. Maintainers need to add Unit Tests to required checks in branch protection to make it a required gate.

Verification

  • pnpm test → 489 passed (30 files), including the previously failing jsonld.test.ts (31/31), seo.test.tsx (29/29), and smoke suites.
  • pnpm build → clean: content/i18n validation, tsc -b, OG image generation (75 images / 25 routes), sitemap (34 routes), RSS feeds.
  • pnpm format:check, pnpm lint:i18n, pnpm test:smoke all pass.
  • The two previously failing-by-environment smoke tests (still serves the built site) pass against the built site.

Align the eight failing tests with the behavior they cover and make the
full unit suite a CI gate so regressions cannot merge unnoticed.

- jsonld.test.ts: the escape-coverage fixture used '</script>', which
  contains no ampersand, so expecting \u0026 in the output failed. Use
  '</script>&' so every escape the serializer emits is exercised.
- Stellar.tsx: Helmet still hardcoded English title/description while
  every other page emits locale-aware metadata from usePageSeo. Wire
  title, description, canonical, and hreflang alternates from pageSeo,
  matching the pageSeo translations shipped for en/es/pt.
- seo.test.tsx: locale tests asserted hero headings that are never
  localized (h1 copy is English-only on Stellar and Grants) and a
  pt case-studies title that does not match the shipped translation.
  Assert the headings that actually render and the pageSeo titles in
  the current es/pt translations.
- ci.yml: add the Unit Tests job running the full suite against a fresh
  build so a failing SEO or serverless unit test blocks the PR; the
  focused Playwright accessibility job stays separate.

All 489 tests pass.
@drips-wave

drips-wave Bot commented Oct 17, 2026

Copy link
Copy Markdown

@gbengaeben Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel

vercel Bot commented Oct 17, 2026

Copy link
Copy Markdown

@gbengaeben is attempting to deploy a commit to the truthixify's projects Team on Vercel.

A member of the Team first needs to authorize it.

@truthixify truthixify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The restored unit gate and SEO corrections pass 60 focused tests and the production build. Approved.

@truthixify
truthixify merged commit c70965e into wraith-protocol:develop Oct 17, 2026
5 of 6 checks passed
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.

[Wave 10] Run the full website unit suite in CI [Wave 10] Restore the full website unit suite to green

2 participants