Skip to content

fix(tests-perf): add unit tests for Navbar/DashboardShell, extend markdown test coverage, disable prefetch on BountyCard, optimize jest transforms and update eslint ignores (#251, #252, #271, #272, #275, #276) - #300

Open
ghzhost wants to merge 1 commit into
MergeFi:mainfrom
ghzhost:test-and-perf-hardening

Conversation

@ghzhost

@ghzhost ghzhost commented Aug 22, 2026

Copy link
Copy Markdown

Summary of Changes

Resolves #251, #252, #271, #272, #275, and #276.

  1. Unit Test Coverage for Navbar (Navbar has no test file, despite an existing open issue describing its loading-state and multi-role rendering logic as buggy #276):

    • Added src/components/layout/Navbar.test.tsx covering loading state, signed-out branch (Sign In / Connect GitHub), signed-in user display + reputation link + logout dispatch, and dashboard navigation dropdown links.
  2. Unit Test Coverage for DashboardShell (DashboardShell has no test file, so its role-based nav-item selection and active-link highlighting (including a known exact-match bug) have zero regression coverage #275):

    • Added src/components/dashboard/DashboardShell.test.tsx testing role-based navigation item selection (contributor, maintainer, sponsor), active route highlight styling, and role switcher buttons.
  3. Extended Test Coverage for BountyDescription (BountyDescription.test.tsx has no coverage for ordered lists, blockquotes, GFM tables, or the h1-h3 heading-level remapping #272):

    • Added unit test coverage in src/components/bounty/BountyDescription.test.tsx verifying ordered list (<ol><li>) rendering, blockquote quote formatting (border-l-2), and markdown header level remapping (# -> <h2>, ## -> <h3>, ### -> <h4>).
  4. Disable Pre-fetch on BountyCard (BountyCard's Link relies on Next.js's default prefetch-on-visible behavior, which combined with request()'s hardcoded no-store caching triggers a full uncached backend fetch for every scrolled-past bounty #271):

    • Set prefetch={false} on <Link href={/issues/${bounty.id}}> inside BountyCard.tsx to avoid issuing uncached no-store backend requests on viewport scroll for bounties that are not explicitly clicked.
  5. Targeted Negative Lookahead in jest.config.ts (jest.config.ts's transformIgnorePatterns: [] transforms the entirety of node_modules on every test run, materially slowing down the suite #251):

    • Replaced blanket empty transformIgnorePatterns: [] with targeted negative lookahead targeting only ESM packages (react-markdown, remark-*, rehype-*, hast-*, micromark*, estree-util-*, etc.), eliminating unnecessary Jest/Babel transform overhead on CommonJS packages.
  6. Add coverage/** to eslint.config.mjs Global Ignores (eslint.config.mjs's globalIgnores claims to override eslint-config-next's defaults but just restates them, and never ignores /coverage #252):

    • Updated eslint.config.mjs to ignore generated coverage/** files when running ESLint.
  7. Test Setup Improvements:

    • Added preset NEXT_PUBLIC_STELLAR_NETWORK="TESTNET" and mock for window.matchMedia in jest.setup.ts to enable full suite execution in JSDOM.

Verification

  • npm test: 13 test suites passed, 110 tests passed.
  • npm run lint: passed without errors.
  • npm run build: passed successfully.

…ntyDescription test coverage, disable prefetch on BountyCard, optimize jest transforms and update eslint ignores (MergeFi#251, MergeFi#252, MergeFi#271, MergeFi#272, MergeFi#275, MergeFi#276)
@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

jest.config.ts's transformIgnorePatterns: [] transforms the entirety of node_modules on every test run, materially slowing down the suite

1 participant