Skip to content

[quality] src/app/docs/layout.tsx (site metadata + JSON-LD graph) has 0% test coverage #169

Description

@hivecommons-hive

Finding

src/app/docs/layout.tsx (160 lines) is at 0% statement coverage in the Vitest suite — the only remaining 0% file under src/app/docs/ after #158/#159 and #154.

It is not a trivial shell: it owns the site-wide SEO surface for docs.hivecommons.dev —

  • the metadata export: metadataBase, canonical /docs, Open Graph (url, siteName, 1200×630 image), Twitter card, robots: { index, follow }, and the keywords list of integration names;
  • the JSON-LD graph injected into <head> via dangerouslySetInnerHTML — two SoftwareApplication entries (Hive, Spektacular) and the Hive Commons Organization with its sponsor/funder lists.

A typo in SITE_URL, a dropped @context, a sponsor without a url, or a mismatch between metadata.keywords and the Hive entry's keywords string would ship with no test failing. The hive/integrations JSON-LD in [...slug]/page.tsx already has a test (docs-slug-page.params-metadata.test.tsx); the root layout's graph does not.

Evidence

  • Unit: npx vitest run --coverage at 39b6472 → src/app/docs/layout.tsx | 0 | 0 | 0 | 0 | 11-160; suite total 82.56% lines / 778 tests.
  • End-to-end: this repository has no e2e/browser suite (no Playwright/Cypress config; .github/workflows/vitest.yml is the only test workflow), so no e2e evidence exists either way.

Recommendation

Add src/__tests__/docs-layout.metadata-jsonld.test.tsx that:

  • mocks next/font/local, next-themes, globals.css and the chrome components (DocsNavbar/DocsFooter/DocsProvider/MobileOverlay), following the SlugLayout pattern in docs-slug-page.params-metadata.test.tsx;
  • asserts the metadata export (origin, canonical, OG/Twitter parity, image dimensions, robots, keyword set);
  • renders the layout with renderToStaticMarkup, extracts and JSON.parses the ld+json script, and asserts the three schema.org entries, Apache-2.0 license + hivecommons codeRepository, sponsor === funder with https urls, and that Hive's keywords string equals metadata.keywords;
  • checks the <html lang="en"> / font-variable body classes and child ordering.

Priority

  • Impact: medium (SEO-critical, covered by unit tests nowhere; no e2e suite exists)
  • Effort: low

Filed by quality agent (ACMM L4/L6 — full mode)


🐝 Hive Agent: quality | Instance: hosted-available-oke-11-placeholder-r05x | SHA: 39b6472

— hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/qualityCreated by Hive for agent-filed issue provenancehive/hosted-available-oke-11-placeholder-r05xCreated by Hive for agent-filed issue provenancehive/likely-doneHive verified that a merged PR references or claims this issue; pending confirmationqualityCreated by Hive for agent-filed issue provenancetestingCreated by Hive for agent-filed issue provenance

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions