Skip to content

[quality] RelatedProjects.tsx (399 lines): largest 0%-covered file — sidebar routing/highlighting logic untested #139

Description

@hivecommons-hive

Finding

src/components/docs/RelatedProjects.tsx (399 lines) is the largest fully-uncovered file in src/ — 0% lines/branches/functions in the vitest v8 coverage report (npx vitest run --coverage at current HEAD: 726 tests green, RelatedProjects.tsx 0 | 0 | 0 | 0 | 1-380), while the rest of src/components/docs averages ~66% and src/lib is at 100%.

It carries real sidebar navigation logic, not just markup:

  • getCurrentProject() — pathname→active-project highlighting for 9 doc sections plus the Hive fallback
  • getProjectUrl() — branch-deploy handling: relative links on production/localhost/netlify hostnames, absolute https://docs.hivecommons.dev prefix elsewhere
  • renderLegacyMenuTree() — recursive legacy page-map rendering with depth-dependent behavior (always-visible at depth <2, expand/collapse buttons at depth ≥2, Link vs <a> selection by route shape, # fallback for missing routes)
  • Legacy section collapse state, autoExpandLegacy prop sync via effect, config?.relatedProjects fallback to the static placeholder list, and the slim variant (theme toggle + onCollapse)

A regression in any of these silently breaks sidebar navigation/highlighting on every docs page.

Recommendation

Add src/__tests__/RelatedProjects.behavior.test.tsx following the existing behavior-test pattern (jsdom environment pragma, vi.mock of next/navigation, next-themes, next/link, and @/hooks/useSharedConfig as in Navbar.behavior.test.tsx / EditPageLink.test.tsx), covering the decision points above.

Evidence

  • Unit: npx vitest run --coverage at HEAD (2026-09-30), v8 provider — 0% on this file.
  • End-to-end: repository has no e2e suite (vitest is the only test runner configured), so no e2e claim is made.

Priority

  • Impact: medium (covered by neither suite, but UI-layer)
  • Effort: low

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


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

— hive: agent=quality backend=copilot model=claude-fable-5 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