Skip to content

Next links / Alias imports#1504

Merged
prxt6529 merged 9 commits intomainfrom
next-links-alias-imports
Oct 2, 2025
Merged

Next links / Alias imports#1504
prxt6529 merged 9 commits intomainfrom
next-links-alias-imports

Conversation

@prxt6529
Copy link
Copy Markdown
Collaborator

@prxt6529 prxt6529 commented Oct 2, 2025

Summary by CodeRabbit

  • New Features
    • Faster, smoother client-side navigation across many pages and components by converting internal anchors to framework-managed Link navigation (no visual changes).
  • Refactor
    • Replaced numerous internal usages with client-side Link wrappers across pages, sections, and UI components.
  • Tests
    • Standardized and strengthened tests: named mock components, consistent attribute/role queries, updated static page and SEO assertions, and refined navigation-related expectations.
  • Chores
    • Minor formatting and whitespace consistency fixes.

Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Oct 2, 2025

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

193 files out of 300 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Replaces many internal anchor () elements with Next.js Link across pages and components and updates two test suites to use named mock components, explicit __esModule/displayName, normalized queries/attributes, and minor type casting. No exported API or component signatures changed.

Changes

Cohort / File(s) Summary
Tests: static and page tests
__tests__/moreStaticPages.test.tsx, __tests__/pages/newStaticPages.test.tsx
Refactor Jest/next/dynamic mocks into named components with displayName and __esModule: true; adjust dynamic import mock shape; normalize queries/attribute assertions (double quotes, getAttribute usage); minor TestProvider type loosenings; whitespace/formatting tweaks.
App pages: Link migration
app/about/100m-project/page.tsx, app/author/6529er6529-io/page.tsx, app/author/ladysabrina/page.tsx, app/capital/page.tsx, app/category/blog/page.tsx, app/category/news/page.tsx, app/dispute-resolution/page.client.tsx, app/education/page.tsx, app/email-signatures/page.tsx, app/museum/6529-fund-szn1/page.tsx, app/museum/6529-fund-szn2/page.tsx, app/museum/genesis/page.tsx, app/museum/page.tsx, app/news/introducing-om/page.tsx, app/om/page.tsx
Replace internal <a> tags with Next.js Link components, add import Link from "next/link", preserve hrefs/content and component signatures; navigation becomes client-side.
Components: About
components/about/AboutDataDecentral.tsx, components/about/AboutMemes.tsx, components/about/AboutMinting.tsx, components/about/AboutNFTDelegation.tsx, components/about/AboutTermsOfService.tsx
Swap internal anchors to Link, add next/link imports, preserve rendering and props.
Components: Community/Delegation/Activity/Leaderboard
components/community-downloads/CommunityDownloads.tsx, components/delegation/CollectionDelegation.tsx, components/latest-activity/ActivityHeader.tsx, components/leaderboard/Leaderboard.tsx
Convert various anchors (including conditional/View All links) to Link; add imports; no logic changes.
Components: MemeLab and Rememes
components/memelab/MemeLab.tsx, components/rememes/RememeAddPage.tsx, components/rememes/RememePage.tsx
Wrap item and in-page anchors with Link for client-side routing; add imports; keep handlers/content intact.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant UI as Page UI (<Link/>)
  participant Router as Next Router
  participant Dest as Target Page

  User->>UI: click internal link
  UI->>Router: Router.push(href)
  note right of Router: Client-side navigation (no full reload)
  Router-->>Dest: load route/component
  Dest-->>User: render destination
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • ragnep

Poem

I hop from anchor to Link with a twitch of my ear,
Tests snug and named, mocks wearing displayName clear.
Pages now glide on client-side wings,
I munch on carrots and celebrate tiny things.
A rabbit's small cheer for the routing we steer. 🥕🐇

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly identifies the migration to Next.js Link components as a primary change, but the mention of “Alias imports” is not reflected in the change summary and may confuse reviewers.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (5)
components/rememes/RememeAddPage.tsx (1)

207-207: Revert to plain anchor tag for same-page hash navigation.

Next.js Link is designed for client-side navigation between pages/routes, not same-page hash anchors. For navigating to #requirements on the same page, a plain <a> tag is simpler, more semantic, and avoids unnecessary JavaScript overhead.

Apply this diff to revert the change:

-                <Link href="#requirements">view requirements</Link>
+                <a href="#requirements">view requirements</a>

You can also remove the unused import at line 19:

-import Link from "next/link";
components/community-downloads/CommunityDownloads.tsx (1)

30-30: Consider migrating to TailwindCSS classes.

The component uses SCSS modules for styling (styles.downloadLink), while the coding guidelines specify that TailwindCSS should be used for styling in .tsx files. Consider refactoring to use TailwindCSS utility classes instead.

As per coding guidelines.

Also applies to: 35-37, 43-45, 51-51, 56-56, 61-61

components/rememes/RememePage.tsx (1)

77-110: Consider converting internal anchor to Link.

The printMemeReferences function uses an anchor tag for internal navigation to /${routerPath}/${nft.id}. Since this PR is converting internal navigation to use Next.js Link components, this anchor could be converted as well for consistency and to enable client-side routing.

Apply this diff to convert the anchor to Link:

                <Col
                  key={`${nft.contract}-${nft.id}`}
                  className="pt-3 pb-3"
                  xs={{ span: 6 }}
                  sm={{ span: 4 }}
                  md={{ span: 3 }}
                  lg={{ span: 3 }}>
-                 <a
-                   href={`/${routerPath}/${nft.id}`}
+                 <Link
+                   href={`/${routerPath}/${nft.id}`}
                    className="decoration-none scale-hover">
                    <Container fluid className="no-padding">
                      <Row>
                        <Col>
                          <NFTImage
                            nft={nft}
                            animation={false}
                            height={300}
                            showBalance={false}
                            showThumbnail={true}
                          />
                        </Col>
                      </Row>
                      <Row>
                        <Col className="text-center pt-2">
                          <b>
                            #{nft.id} - {nft.name}
                          </b>
                        </Col>
                      </Row>
                      <Row>
                        <Col className="text-center pt-2">
                          Artist Name: {nft.artist}
                        </Col>
                      </Row>
                      <Row>
                        <Col className="text-center pt-2">
                          Artist Profile: <ArtistProfileHandle nft={nft} />
                        </Col>
                      </Row>
                    </Container>
-                 </a>
+                 </Link>
                </Col>
app/author/ladysabrina/page.tsx (1)

7-236: Consider refactoring inline metadata to use Next.js Metadata API.

The file contains extensive inline <meta>, <link>, and <style> tags that should ideally be managed through Next.js's Metadata API in the generateMetadata function. Currently, generateMetadata only sets the title, while the component contains ~230 lines of hardcoded metadata and styles.

Benefits of refactoring:

  • Better SEO optimization through proper metadata handling
  • Improved performance (Next.js can optimize metadata delivery)
  • Easier maintenance and consistency across pages
  • Removal of dangerouslySetInnerHTML usage

Example refactor for the generateMetadata function:

export async function generateMetadata(): Promise<Metadata> {
  return getAppMetadata({
    title: "Sabrina Khan, Author at 6529.io",
    description: "Author page for Sabrina Khan",
    openGraph: {
      locale: "en_US",
      type: "profile",
      title: "Sabrina Khan, Author at 6529.io",
      url: "/author/ladysabrina/",
      siteName: "6529.io",
      images: [
        {
          url: "https://secure.gravatar.com/avatar/0421ede5378d7fa65c28a4f6dfa0df79?s=500&d=mm&r=g",
        },
      ],
    },
    twitter: {
      card: "summary_large_image",
      site: "@om100m",
    },
  });
}

Note: This refactor may be substantial and could be deferred to a separate PR focused on technical debt cleanup.

app/about/100m-project/page.tsx (1)

319-325: Prefer a plain anchor for external URLs.

next/link is optimized for internal routing; using it for https://twitter.com/... adds unnecessary client routing overhead. A regular <a> keeps the intent clear and avoids extra prefetch logic.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 111b797 and 5c82cb8.

📒 Files selected for processing (30)
  • __tests__/moreStaticPages.test.tsx (8 hunks)
  • __tests__/pages/newStaticPages.test.tsx (1 hunks)
  • app/about/100m-project/page.tsx (4 hunks)
  • app/author/6529er6529-io/page.tsx (6 hunks)
  • app/author/ladysabrina/page.tsx (13 hunks)
  • app/capital/page.tsx (4 hunks)
  • app/category/blog/page.tsx (13 hunks)
  • app/category/news/page.tsx (5 hunks)
  • app/dispute-resolution/page.client.tsx (2 hunks)
  • app/education/page.tsx (4 hunks)
  • app/email-signatures/page.tsx (7 hunks)
  • app/museum/6529-fund-szn1/page.tsx (15 hunks)
  • app/museum/6529-fund-szn2/page.tsx (4 hunks)
  • app/museum/genesis/page.tsx (10 hunks)
  • app/museum/page.tsx (15 hunks)
  • app/news/introducing-om/page.tsx (3 hunks)
  • app/om/page.tsx (7 hunks)
  • components/about/AboutDataDecentral.tsx (2 hunks)
  • components/about/AboutMemes.tsx (2 hunks)
  • components/about/AboutMinting.tsx (2 hunks)
  • components/about/AboutNFTDelegation.tsx (2 hunks)
  • components/about/AboutTermsOfService.tsx (2 hunks)
  • components/community-downloads/CommunityDownloads.tsx (2 hunks)
  • components/delegation/CollectionDelegation.tsx (3 hunks)
  • components/latest-activity/ActivityHeader.tsx (2 hunks)
  • components/leaderboard/Leaderboard.tsx (2 hunks)
  • components/memelab/MemeLab.tsx (3 hunks)
  • components/rememes/RememeAddPage.tsx (2 hunks)
  • components/rememes/RememePage.tsx (2 hunks)
  • public/ens.html (1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Do not include any comments in the code
Use react-query for data fetching
Always add readonly before props

Use TypeScript for implementation code

Files:

  • app/museum/6529-fund-szn2/page.tsx
  • components/about/AboutDataDecentral.tsx
  • components/leaderboard/Leaderboard.tsx
  • components/community-downloads/CommunityDownloads.tsx
  • app/museum/genesis/page.tsx
  • components/about/AboutMemes.tsx
  • app/dispute-resolution/page.client.tsx
  • app/category/blog/page.tsx
  • app/author/ladysabrina/page.tsx
  • __tests__/pages/newStaticPages.test.tsx
  • components/delegation/CollectionDelegation.tsx
  • app/about/100m-project/page.tsx
  • components/about/AboutTermsOfService.tsx
  • app/author/6529er6529-io/page.tsx
  • app/news/introducing-om/page.tsx
  • app/category/news/page.tsx
  • components/rememes/RememeAddPage.tsx
  • components/about/AboutNFTDelegation.tsx
  • components/memelab/MemeLab.tsx
  • app/om/page.tsx
  • components/latest-activity/ActivityHeader.tsx
  • app/capital/page.tsx
  • app/email-signatures/page.tsx
  • app/museum/page.tsx
  • app/education/page.tsx
  • components/about/AboutMinting.tsx
  • __tests__/moreStaticPages.test.tsx
  • components/rememes/RememePage.tsx
  • app/museum/6529-fund-szn1/page.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursorrules)

**/*.tsx: Use FontAwesome for icons
Use TailwindCSS for styling

Use React functional components with hooks

Files:

  • app/museum/6529-fund-szn2/page.tsx
  • components/about/AboutDataDecentral.tsx
  • components/leaderboard/Leaderboard.tsx
  • components/community-downloads/CommunityDownloads.tsx
  • app/museum/genesis/page.tsx
  • components/about/AboutMemes.tsx
  • app/dispute-resolution/page.client.tsx
  • app/category/blog/page.tsx
  • app/author/ladysabrina/page.tsx
  • __tests__/pages/newStaticPages.test.tsx
  • components/delegation/CollectionDelegation.tsx
  • app/about/100m-project/page.tsx
  • components/about/AboutTermsOfService.tsx
  • app/author/6529er6529-io/page.tsx
  • app/news/introducing-om/page.tsx
  • app/category/news/page.tsx
  • components/rememes/RememeAddPage.tsx
  • components/about/AboutNFTDelegation.tsx
  • components/memelab/MemeLab.tsx
  • app/om/page.tsx
  • components/latest-activity/ActivityHeader.tsx
  • app/capital/page.tsx
  • app/email-signatures/page.tsx
  • app/museum/page.tsx
  • app/education/page.tsx
  • components/about/AboutMinting.tsx
  • __tests__/moreStaticPages.test.tsx
  • components/rememes/RememePage.tsx
  • app/museum/6529-fund-szn1/page.tsx
{app,pages}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

Use NextJS features that match the current version

Files:

  • app/museum/6529-fund-szn2/page.tsx
  • app/museum/genesis/page.tsx
  • app/dispute-resolution/page.client.tsx
  • app/category/blog/page.tsx
  • app/author/ladysabrina/page.tsx
  • app/about/100m-project/page.tsx
  • app/author/6529er6529-io/page.tsx
  • app/news/introducing-om/page.tsx
  • app/category/news/page.tsx
  • app/om/page.tsx
  • app/capital/page.tsx
  • app/email-signatures/page.tsx
  • app/museum/page.tsx
  • app/education/page.tsx
  • app/museum/6529-fund-szn1/page.tsx
app/**/page.tsx

📄 CodeRabbit inference engine (AGENTS.md)

All new pages must be created inside the app/ directory

Files:

  • app/museum/6529-fund-szn2/page.tsx
  • app/museum/genesis/page.tsx
  • app/category/blog/page.tsx
  • app/author/ladysabrina/page.tsx
  • app/about/100m-project/page.tsx
  • app/author/6529er6529-io/page.tsx
  • app/news/introducing-om/page.tsx
  • app/category/news/page.tsx
  • app/om/page.tsx
  • app/capital/page.tsx
  • app/email-signatures/page.tsx
  • app/museum/page.tsx
  • app/education/page.tsx
  • app/museum/6529-fund-szn1/page.tsx
app/**/{page,layout}.tsx

📄 CodeRabbit inference engine (AGENTS.md)

Routes in app/ should export a generateMetadata function using getAppMetadata

Files:

  • app/museum/6529-fund-szn2/page.tsx
  • app/museum/genesis/page.tsx
  • app/category/blog/page.tsx
  • app/author/ladysabrina/page.tsx
  • app/about/100m-project/page.tsx
  • app/author/6529er6529-io/page.tsx
  • app/news/introducing-om/page.tsx
  • app/category/news/page.tsx
  • app/om/page.tsx
  • app/capital/page.tsx
  • app/email-signatures/page.tsx
  • app/museum/page.tsx
  • app/education/page.tsx
  • app/museum/6529-fund-szn1/page.tsx
**/{__tests__/**/*.{ts,tsx},*.test.tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/{__tests__/**/*.{ts,tsx},*.test.tsx}: Place tests in tests directories or alongside components as ComponentName.test.tsx
Mock external dependencies and APIs in tests

Files:

  • __tests__/pages/newStaticPages.test.tsx
  • __tests__/moreStaticPages.test.tsx
__tests__/**

📄 CodeRabbit inference engine (tests/AGENTS.md)

Place Jest test suites under the __tests__ directory mirroring source folders (e.g., components, contexts, hooks, utils)

Files:

  • __tests__/pages/newStaticPages.test.tsx
  • __tests__/moreStaticPages.test.tsx
🧠 Learnings (4)
📚 Learning: 2025-09-28T12:32:36.068Z
Learnt from: CR
PR: 6529-Collections/6529seize-frontend#0
File: AGENTS.md:0-0
Timestamp: 2025-09-28T12:32:36.068Z
Learning: Applies to **/{__tests__/**/*.{ts,tsx},*.test.tsx} : Mock external dependencies and APIs in tests

Applied to files:

  • __tests__/pages/newStaticPages.test.tsx
  • __tests__/moreStaticPages.test.tsx
📚 Learning: 2025-09-28T12:32:36.068Z
Learnt from: CR
PR: 6529-Collections/6529seize-frontend#0
File: AGENTS.md:0-0
Timestamp: 2025-09-28T12:32:36.068Z
Learning: Applies to app/**/{page,layout}.tsx : Routes in app/ should export a generateMetadata function using getAppMetadata

Applied to files:

  • app/om/page.tsx
📚 Learning: 2025-09-28T12:33:07.551Z
Learnt from: CR
PR: 6529-Collections/6529seize-frontend#0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.551Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Keep mock implementations minimal—only what’s necessary for the test scenarios

Applied to files:

  • __tests__/moreStaticPages.test.tsx
📚 Learning: 2025-09-28T12:33:07.551Z
Learnt from: CR
PR: 6529-Collections/6529seize-frontend#0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.551Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Document non-obvious expected behaviour directly in the mock file

Applied to files:

  • __tests__/moreStaticPages.test.tsx
🧬 Code graph analysis (2)
components/delegation/CollectionDelegation.tsx (1)
components/delegation/delegation-constants.ts (1)
  • ANY_COLLECTION_PATH (12-12)
__tests__/moreStaticPages.test.tsx (1)
components/auth/Auth.tsx (1)
  • AuthContext (83-93)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (19)
components/about/AboutTermsOfService.tsx (1)

1-1: Next.js Link migration looks good.

Import and usage follow the app router API, preserving target/rel semantics for the new-tab behavior. Nothing else to flag.

Also applies to: 621-627

components/delegation/CollectionDelegation.tsx (3)

4-4: LGTM!

The Link import from next/link is correct and follows Next.js conventions for client-side navigation.


1760-1763: LGTM!

The migration from an anchor tag to Next.js Link component for the "All Collections" link is correct. The href construction using ANY_COLLECTION_PATH constant is appropriate and enables client-side routing.


1781-1783: LGTM!

Consistent migration to Next.js Link component for the second "All Collections" link. The implementation matches the first replacement and correctly enables client-side routing.

components/community-downloads/CommunityDownloads.tsx (5)

3-3: LGTM!

The Next.js Link import is correctly added and follows the standard pattern for client-side navigation.


29-31: LGTM!

The conversion from anchor tag to Next.js Link component is correct and will enable client-side navigation for improved performance.


34-38: LGTM!

The Link component conversion is correct and consistent with the established pattern.


42-46: LGTM!

The Link component conversion correctly preserves the conditional rendering logic for platform and region restrictions.


50-62: LGTM!

The remaining Link component conversions (Rememes, Team, Royalties) are all correctly implemented and follow the consistent pattern established in the file.

components/rememes/RememePage.tsx (2)

10-10: LGTM! Import added correctly.

The Next.js Link import is properly positioned and formatted.


348-350: LGTM! Proper Next.js Link usage for client-side routing.

The conversion from anchor tag to Link component is correct and enables client-side navigation for replica items.

app/author/ladysabrina/page.tsx (1)

2-2: LGTM - Correct Next.js Link import.

The import is properly added to support client-side navigation with Link components throughout the page.

components/about/AboutNFTDelegation.tsx (1)

1-1: LGTM! Link component migration looks good.

The addition of the Link import and replacement of the anchor tag with a Next.js Link component correctly enables client-side routing for the internal navigation to /delegation/delegation-center.

Also applies to: 17-18

components/leaderboard/Leaderboard.tsx (1)

3-3: LGTM! Link component migration is correct.

The addition of the Link import and replacement of the "View All" anchor with a Next.js Link component correctly enables client-side routing to /network/nerd. The implementation is appropriate for this client component.

Also applies to: 177-179

components/about/AboutDataDecentral.tsx (1)

1-1: LGTM! Link component migration is correct.

The addition of the Link import and replacement of the anchor with a Next.js Link component correctly enables client-side routing to /open-data. The target="_blank" attribute is preserved, which will open the internal route in a new tab.

Also applies to: 85-87

app/dispute-resolution/page.client.tsx (1)

3-3: LGTM! Link component migration with dynamic href is correct.

The addition of the Link import and replacement of the anchor with a Next.js Link component correctly enables client-side routing. The href construction using the AboutSection.TERMS_OF_SERVICE enum is appropriate and maintains type safety.

Also applies to: 82-84

app/capital/page.tsx (1)

2-2: LGTM! Multiple Link component migrations are correct.

The addition of the Link import and replacement of multiple internal navigation anchors with Next.js Link components correctly enables client-side routing throughout the page. All href targets are internal routes and the migrations follow the standard pattern.

Also applies to: 304-309, 377-381, 801-803

app/om/page.tsx (1)

2-2: LGTM! Comprehensive Link component migrations are correct.

The addition of the Link import and replacement of multiple internal navigation anchors with Next.js Link components correctly enables client-side routing throughout the page. The migrations cover various use cases including text links, button-styled links, and image links—all following the standard pattern for internal routes.

Also applies to: 314-319, 407-407, 788-790, 797-799, 806-808, 819-826, 845-861, 1117-1119

app/news/introducing-om/page.tsx (1)

2-2: LGTM! Link component migrations are correct.

The addition of the Link import and replacement of internal navigation anchors with Next.js Link components correctly enables client-side routing. All href targets are internal routes and the migrations follow the standard pattern.

Also applies to: 407-407, 436-441

Comment thread __tests__/moreStaticPages.test.tsx Outdated
Comment thread app/author/ladysabrina/page.tsx
Comment thread public/ens.html Outdated
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
__tests__/moreStaticPages.test.tsx (1)

29-46: Consider adding displayName to mock components for consistency.

The named function components provide better debugging than inline arrows. However, for consistency with the MockDynamicComponent pattern (line 15), consider adding displayName to each mock:

 jest.mock(
   "@/components/distribution-plan-tool/wrapper/DistributionPlanToolWrapper",
   () =>
     function MockDistributionPlanToolWrapper({ children }: any) {
+      MockDistributionPlanToolWrapper.displayName = "MockDistributionPlanToolWrapper";
       return <div data-testid="wrapper">{children}</div>;
     }
 );
 jest.mock(
   "@/components/distribution-plan-tool/plans/DistributionPlanToolPlans",
   () =>
     function MockDistributionPlanToolPlans() {
+      MockDistributionPlanToolPlans.displayName = "MockDistributionPlanToolPlans";
       return <div data-testid="plans" />;
     }
 );
 jest.mock(
   "@/components/distribution-plan-tool/create-plan/DistributionPlanToolCreatePlan",
   () =>
     function MockDistributionPlanToolCreatePlan() {
+      MockDistributionPlanToolCreatePlan.displayName = "MockDistributionPlanToolCreatePlan";
       return <div data-testid="create" />;
     }
 );
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5c82cb8 and 907a5f7.

📒 Files selected for processing (2)
  • __tests__/moreStaticPages.test.tsx (8 hunks)
  • app/author/ladysabrina/page.tsx (13 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/author/ladysabrina/page.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursorrules)

**/*.{ts,tsx}: Do not include any comments in the code
Use react-query for data fetching
Always add readonly before props

Use TypeScript for implementation code

Files:

  • __tests__/moreStaticPages.test.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursorrules)

**/*.tsx: Use FontAwesome for icons
Use TailwindCSS for styling

Use React functional components with hooks

Files:

  • __tests__/moreStaticPages.test.tsx
**/{__tests__/**/*.{ts,tsx},*.test.tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/{__tests__/**/*.{ts,tsx},*.test.tsx}: Place tests in tests directories or alongside components as ComponentName.test.tsx
Mock external dependencies and APIs in tests

Files:

  • __tests__/moreStaticPages.test.tsx
__tests__/**

📄 CodeRabbit inference engine (tests/AGENTS.md)

Place Jest test suites under the __tests__ directory mirroring source folders (e.g., components, contexts, hooks, utils)

Files:

  • __tests__/moreStaticPages.test.tsx
🧠 Learnings (1)
📚 Learning: 2025-09-28T12:33:07.551Z
Learnt from: CR
PR: 6529-Collections/6529seize-frontend#0
File: __mocks__/AGENTS.md:0-0
Timestamp: 2025-09-28T12:33:07.551Z
Learning: Applies to __mocks__/**/__mocks__/**/*.{js,jsx,ts,tsx} : Document non-obvious expected behaviour directly in the mock file

Applied to files:

  • __tests__/moreStaticPages.test.tsx
🧬 Code graph analysis (1)
__tests__/moreStaticPages.test.tsx (1)
components/auth/Auth.tsx (1)
  • AuthContext (83-93)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (10)
__tests__/moreStaticPages.test.tsx (10)

5-5: LGTM: NotFoundPage import added for test coverage.

The import is necessary for the 404 page test added in this file.


13-17: LGTM: Dynamic mock corrected.

The mock now returns the component directly on first invocation, fixing the previous issue where the triple-arrow function caused React to receive a function instead of JSX. The displayName assignment and data-testid are properly configured.


18-21: LGTM: Proper ES module mock structure.

The __esModule: true flag and jest.fn() wrapper correctly mock the default export as an ES module, consistent with the MemeLabCollection mock pattern below.


57-57: LGTM: Type cast appropriate for test mocking.

The any cast allows the test provider to supply only the minimal AuthContext properties needed by the components under test, avoiding the need to mock all properties from the full AuthContextType interface.


91-121: LGTM: Comprehensive 404 page test.

The test thoroughly validates the NotFoundPage component, including error message display, navigation links, back button interaction, and visual elements. The consistent use of double-quoted strings and specific role queries aligns with the updated testing patterns.


123-146: LGTM: Well-structured dispute resolution test.

The test effectively validates the DisputeResolution page content with role-based queries and consistent double-quoted string assertions.


148-162: LGTM: Gradient page test with proper structure validation.

The test correctly validates both the dynamic component rendering and the page structure, ensuring the main element has the expected class.


164-183: LGTM: Complete EMMA plans page validation.

The test comprehensively validates the PlansPage component, including heading, description, and all three distribution tool components (wrapper, plans, create).


185-207: LGTM: Proper async page testing with collection name transformation.

The test correctly handles the async page component pattern and validates the collection name transformation from kebab-case to space-separated format ("test-collection" → "test collection").


209-223: LGTM: Multi-word collection name edge case covered.

The test validates the collection name transformation for multi-word inputs, ensuring "multi-word-collection-name" correctly becomes "multi word collection name".

Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
ragnep
ragnep previously approved these changes Oct 2, 2025
Signed-off-by: prxt6529 <prxt@6529.io>
Signed-off-by: prxt6529 <prxt@6529.io>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Oct 2, 2025

@prxt6529 prxt6529 merged commit 965e770 into main Oct 2, 2025
8 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Oct 13, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Oct 28, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Nov 12, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Feb 10, 2026
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.

2 participants