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
Open
Conversation
…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)
|
Someone is attempting to deploy a commit to the chonilius' projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of Changes
Resolves #251, #252, #271, #272, #275, and #276.
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):src/components/layout/Navbar.test.tsxcovering loading state, signed-out branch (Sign In / Connect GitHub), signed-in user display + reputation link + logout dispatch, and dashboard navigation dropdown links.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):src/components/dashboard/DashboardShell.test.tsxtesting role-based navigation item selection (contributor,maintainer,sponsor), active route highlight styling, and role switcher buttons.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):src/components/bounty/BountyDescription.test.tsxverifying ordered list (<ol><li>) rendering, blockquote quote formatting (border-l-2), and markdown header level remapping (#-><h2>,##-><h3>,###-><h4>).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):prefetch={false}on<Link href={/issues/${bounty.id}}>insideBountyCard.tsxto avoid issuing uncachedno-storebackend requests on viewport scroll for bounties that are not explicitly clicked.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):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.Add
coverage/**toeslint.config.mjsGlobal Ignores (eslint.config.mjs's globalIgnores claims to override eslint-config-next's defaults but just restates them, and never ignores /coverage #252):eslint.config.mjsto ignore generatedcoverage/**files when running ESLint.Test Setup Improvements:
NEXT_PUBLIC_STELLAR_NETWORK="TESTNET"and mock forwindow.matchMediainjest.setup.tsto 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.