Skip to content

Conversation

@Abhi1992002
Copy link
Contributor

@Abhi1992002 Abhi1992002 commented Jan 23, 2026

Add Integration Tests for Marketplace Pages

Changes πŸ—οΈ

  • Added comprehensive integration tests for marketplace pages:
    • MainAgentPage tests for rendering, auth state, and error handling
    • MainCreatorPage tests for rendering, auth state, and error handling
    • MainMarketplacePage tests with expanded test coverage
    • MainSearchResultPage tests for rendering, auth state, and error handling
  • Added test helpers:
    • create-500-handler.ts for testing server error responses
    • mock-supabase-auth.ts for simulating authenticated/unauthenticated states
    • mock-onboarding-provider.tsx for mocking the onboarding context
    • supress-react-query-update-warning.ts to reduce noise in test output
  • Fixed version parsing in AgentInfo component to filter out NaN values
  • Added @testing-library/jest-dom for enhanced DOM assertions
  • Reorganized package.json dependencies
  • Updated test setup to improve test reliability and reduce console noise
  • Removed redundant E2E tests that are now covered by integration tests

Checklist πŸ“‹

For code changes:

  • I have clearly listed my changes in the PR description
  • I have made a test plan
  • I have tested my changes according to the test plan:
    • Run all integration tests with pnpm test
    • Verify tests pass in CI pipeline
    • Manually test marketplace pages to ensure functionality is preserved

…d happy-dom

### Changes πŸ—οΈ
- Removed `happy-dom` from `devDependencies` and added it back in a different section for clarity.
- Added `@testing-library/jest-dom` to `devDependencies` for improved testing assertions.
- Updated `tsconfig.json` to include types for `@testing-library/jest-dom`.
- Configured Vitest to enable global variables for testing.
- Imported `@testing-library/jest-dom` in the Vitest setup file for enhanced testing capabilities.

### Checklist πŸ“‹
- [x] Verified that all tests pass with the new setup.
- [x] Ensured that the testing environment is correctly configured for integration tests.
…onents

### Changes πŸ—οΈ
- Updated `MainMarketplacePage` tests to include rendering checks for various sections and error handling for API failures.
- Improved `AgentInfo` component to filter out NaN values from version numbers.
- Modified `customMutator` to conditionally log errors based on the environment.
- Enhanced Vitest configuration for better integration testing setup.
- Refactored existing tests for marketplace agents and creators to focus on cross-page flows.

### Checklist πŸ“‹
- [x] Verified that all tests pass with the new changes.
- [x] Ensured comprehensive coverage for error handling scenarios in tests.
- [x] Updated documentation for testing practices in `CLAUDE.md`.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 23, 2026

Walkthrough

This PR adds comprehensive unit test coverage for frontend marketplace components (MainAgentPage, MainCreatorPage, MainMarketplacePage, MainSearchResultPage) with tests for authentication states, error handling, rendering, and loading states. It introduces test helpers for mocking authentication, 500 errors, and onboarding providers, updates Vitest configuration to support global test matchers, and refactors E2E tests to focus on navigation flows. A minor fix filters NaN values from version parsing in AgentInfo.

Changes

Cohort / File(s) Summary
Test Dependencies & Configuration
package.json, tsconfig.json, vitest.config.mts, src/tests/integrations/vitest.setup.tsx
Added @testing-library/jest-dom dependency (6.9.1); enabled Vitest globals and Jest-DOM types; configured Vitest with global test variables; integrated React Query warning suppression in setup lifecycle.
Test Helper Functions
src/tests/integrations/helpers/mock-supabase-auth.ts, src/tests/integrations/helpers/create-500-handler.ts, src/tests/integrations/helpers/suppress-react-query-update-warning.ts, src/tests/integrations/helpers/mock-onboarding-provider.tsx, src/tests/integrations/test-utils.tsx
Added authentication state mocking (mockAuthenticatedUser, mockUnauthenticatedUser, resetAuthState); 500 error handler factory; React Query warning suppression utility; mock onboarding provider; updated TestProviders to use MockOnboardingProvider and mock onboarding module.
MainAgentPage Tests
src/app/(platform)/marketplace/components/MainAgentPage/__tests__/auth-state.test.tsx, src/app/(platform)/marketplace/components/MainAgentPage/__tests__/error-handling.test.tsx, src/app/(platform)/marketplace/components/MainAgentPage/__tests__/rendering.test.tsx
Added tests covering authenticated/unauthenticated visibility states, error response handling (422/500), and element rendering (title, creator, description, download button, similar agents).
MainCreatorPage Tests
src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/auth-state.test.tsx, src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/error-handling.test.tsx, src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
Added tests for auth states, error handling with generic failure messages, and rendering of creator description, breadcrumbs, About section, and Agents list.
MainMarketplacePage Tests
src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/auth-state.test.tsx, src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/empty-state.test.tsx, src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx, src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx, src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/rendering.test.tsx
Added tests for auth states, empty/partial data scenarios, error handling with retry button, loading skeleton detection, and rendering of featured/top agents and creators sections. Removed outdated main.test.tsx.
MainSearchResultPage Tests
src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/auth-state.test.tsx, src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx, src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/no-results.test.tsx, src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/rendering.test.tsx
Added tests for auth state rendering, error handling, no-results scenarios with search term preservation, and header/search input rendering.
Component Code
src/app/(platform)/marketplace/components/AgentInfo/AgentInfo.tsx
Added NaN filter step after parsing version strings to prevent invalid numeric values from affecting sort operations.
E2E Test Consolidation
src/tests/marketplace-agent.spec.ts, src/tests/marketplace-creator.spec.ts, src/tests/marketplace.spec.ts
Consolidated multi-test suites into focused cross-page flow tests; removed authentication setup, individual visibility checks, and edge-case tests; refactored to navigation-centric assertions.
Documentation
src/tests/CLAUDE.md
Added sections documenting 500 error testing patterns and auth-dependent component testing with mock helpers and examples.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Possibly related PRs

  • #11820 β€” Overlapping changes to frontend testing setup and MainMarketplacePage tests with Vitest configuration.
  • #11813 β€” Modifies shared frontend testing infrastructure (Vitest/MSW setup, test utilities, mock helpers, tsconfig/vitest config).
  • #11706 β€” Modifies AgentInfo.tsx component version handling logic.

Suggested labels

testing, frontend, marketplace, test-infrastructure

Suggested reviewers

  • 0ubbe
  • Bentlybro
  • kcze

Poem

🐰 Hoppity-hop, test files align,
Authentication mocks and helpers so fine,
Error states caught, empty states too,
Marketplace tested through and through!
Jest-DOM globals make assertions complete,
A test suite so cozy, so tidy, so neat!

πŸš₯ Pre-merge checks | βœ… 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
βœ… Passed checks (2 passed)
Check name Status Explanation
Title check βœ… Passed The title clearly and specifically describes the main changes: adding marketplace component tests and fixing version filtering, which are the core objectives of this PR.
Description check βœ… Passed The description is well-organized and directly related to the changeset, detailing the integration tests added, test helpers created, and bug fixes made across the marketplace pages.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • πŸ“ Generate docstrings
πŸ§ͺ Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch abhi/marketplace-integration-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

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

@github-actions github-actions bot added the platform/frontend AutoGPT Platform - Front end label Jan 23, 2026
@Abhi1992002 Abhi1992002 changed the title Abhi/marketplace integration tests feat(frontend): add marketplace component tests and fix version filtering Jan 23, 2026
Otto-AGPT and others added 2 commits January 30, 2026 06:11
…e-specific locations

- Split main.test.tsx files into dedicated test files:
  - rendering.test.tsx - Component rendering tests
  - auth-state.test.tsx - Authentication state tests
  - error-handling.test.tsx - API error handling tests

- Add new test files:
  - loading-state.test.tsx - Loading skeleton tests
  - empty-state.test.tsx - Empty data handling tests
  - no-results.test.tsx - Search with no results tests

Test coverage:
- MainMarketplacePage: 14 tests (5 files)
- MainAgentPage: 13 tests (3 files)
- MainCreatorPage: 10 tests (3 files)
- MainSearchResultPage: 11 tests (4 files)
- Total: 48 tests across 15 files
@Abhi1992002 Abhi1992002 marked this pull request as ready for review January 30, 2026 06:12
@Abhi1992002 Abhi1992002 requested a review from a team as a code owner January 30, 2026 06:12
@Abhi1992002 Abhi1992002 requested review from Bentlybro and kcze and removed request for a team January 30, 2026 06:12
Copy link
Contributor

@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: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
autogpt_platform/frontend/src/tests/marketplace.spec.ts (1)

36-64: ⚠️ Potential issue | 🟑 Minor

Stabilize the search term expectation to avoid data-dependent flakes.
The test uses "DummyInput" and expects results > 0, which can fail if search data changes or seeds are missing. Consider using a deterministic fixture/seeded term (or mocking the search response) so the assertion is stable.

autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts (1)

21-45: ⚠️ Potential issue | 🟑 Minor

Avoid flakiness if the selected agent is already in the user’s library.
getTestUserWithLibraryAgents() plus β€œfirst top agent” can select an agent that’s already in the library, causing the add button to be absent/disabled. Consider ensuring the agent is not in the library before clicking, or use a clean user fixture for this test.

πŸ€– Fix all issues with AI agents
In
`@autogpt_platform/frontend/src/app/`(platform)/marketplace/components/MainCreatorPage/__tests__/error-handling.test.tsx:
- Around line 21-25: The test currently uses waitFor(() =>
expect(screen.getByText("Failed to load creator data", { exact: false
})).toBeInTheDocument()) (and three other similar occurrences using waitFor +
screen.getByText); replace each instance with the idiomatic async RTL query
using await screen.findByText("Failed to load creator data", { exact: false })
and assert presence (e.g., expect(await
screen.findByText(...)).toBeInTheDocument()); update all four occurrences that
call screen.getByText inside waitFor to use await screen.findByText instead to
reduce flakiness.

In
`@autogpt_platform/frontend/src/app/`(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx:
- Around line 39-41: The unit test in loading-state.test.tsx currently asserts
presence of the styling class via
container.querySelectorAll('[class*="animate-pulse"]') (loadingElements) which
is a styling detail; change the assertion to test behavior/accessibility
insteadβ€”e.g., update the component to render a stable data-testid like
"loading-skeleton" or use an accessible role (e.g., getByRole/getAllByRole or
getByTestId) and assert those elements exist rather than matching CSS class
names, and update the test to use that test-id/role lookup; also remove the two
inline comments in this test file (the comment describing the loading skeleton
and the other inline comment) to comply with the "avoid comments unless complex"
guideline.

In
`@autogpt_platform/frontend/src/tests/integrations/helpers/mock-onboarding-provider.tsx`:
- Around line 2-4: Replace the deprecated UserOnboarding import with the
generated RawUserOnboarding type from
"@/app/api/__generated__/models/userOnboarding" (or import the conversion
wrapper from "@/providers/onboarding/helpers" if you need it), update any
occurrences typed as UserOnboarding | null to RawUserOnboarding | null
(including state, props, and function signatures in
mock-onboarding-provider.tsx), and extract the inline props type currently
defined inline into a top-level interface Props (rename the inline type to
interface Props and update the component signature to use Props) to follow
frontend guidelines.

In
`@autogpt_platform/frontend/src/tests/integrations/helpers/supress-react-query-update-warning.ts`:
- Around line 1-37: The filename has a typoβ€”rename the file from
supress-react-query-update-warning.ts to suppress-react-query-update-warning.ts
and update all imports/usages accordingly; ensure the exported function
suppressReactQueryUpdateWarning (and any test helper references) keeps the same
name and update any paths or module imports that reference "supress" to the new
"suppress" filename so CI and tests pick up the helper.
🧹 Nitpick comments (19)
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/no-results.test.tsx (4)

9-9: Redundant type cast.

undefined as undefined is unnecessary; undefined is already typed correctly.

Suggested fix
 const defaultProps = {
   searchTerm: "nonexistent-search-term-xyz",
-  sort: undefined as undefined,
+  sort: undefined,
 };

41-46: Remove comment and prefer findBy over waitFor + getBy.

The comment on line 45 is unnecessary as the assertion is self-documenting. Additionally, findByText handles waiting internally and is the recommended pattern for async queries. As per coding guidelines, avoid comments unless the code is very complex. Based on learnings, use findBy... methods in integration tests to wait for elements and avoid flaky tests.

Suggested fix
-    await waitFor(() => {
-      expect(screen.getByText("Results for:")).toBeInTheDocument();
-    });
-    
-    // Verify search term is displayed
-    expect(screen.getByText("nonexistent-search-term-xyz")).toBeInTheDocument();
+    expect(await screen.findByText("Results for:")).toBeInTheDocument();
+    expect(screen.getByText("nonexistent-search-term-xyz")).toBeInTheDocument();

49-69: Inconsistent MSW handler setup and potential test overlap.

This test only mocks the agents endpoint while test 1 mocks both agents and creators. If MainSearchResultPage fetches both, the missing creators handler could cause unexpected behavior or flaky tests. Additionally, this test's assertion overlaps with test 1 (both verify the search term is displayed).

Consider either:

  1. Adding the creators handler for consistency, or
  2. Removing this test if it's redundant with test 1

Also, prefer findByText over waitFor + getByText.

Suggested fix if keeping the test
   test("displays search term even with no results", async () => {
     server.use(
       http.get("*/api/store/agents*", () => {
         return HttpResponse.json({
           agents: [],
           pagination: {
             total_items: 0,
             total_pages: 0,
             current_page: 1,
             page_size: 10,
           },
         });
       }),
+      http.get("*/api/store/creators*", () => {
+        return HttpResponse.json({
+          creators: [],
+          pagination: {
+            total_items: 0,
+            total_pages: 0,
+            current_page: 1,
+            page_size: 10,
+          },
+        });
+      }),
     );

     render(<MainSearchResultPage {...defaultProps} />);

-    await waitFor(() => {
-      expect(screen.getByText("nonexistent-search-term-xyz")).toBeInTheDocument();
-    });
+    expect(await screen.findByText("nonexistent-search-term-xyz")).toBeInTheDocument();
   });

71-91: Test name implies functionality but only asserts presence.

The test is named "search bar remains functional" but only verifies the input exists. Consider either:

  • Renaming to "search bar is present with no results", or
  • Adding assertions that actually test functionality (e.g., typing in the input, verifying value changes)

Also, add the missing creators handler for consistency with test 1, and use findByPlaceholderText.

Suggested fix
-  test("search bar remains functional with no results", async () => {
+  test("search bar is present with no results", async () => {
     server.use(
       http.get("*/api/store/agents*", () => {
         return HttpResponse.json({
           agents: [],
           pagination: {
             total_items: 0,
             total_pages: 0,
             current_page: 1,
             page_size: 10,
           },
         });
       }),
+      http.get("*/api/store/creators*", () => {
+        return HttpResponse.json({
+          creators: [],
+          pagination: {
+            total_items: 0,
+            total_pages: 0,
+            current_page: 1,
+            page_size: 10,
+          },
+        });
+      }),
     );

     render(<MainSearchResultPage {...defaultProps} />);

-    await waitFor(() => {
-      expect(screen.getByPlaceholderText(/search/i)).toBeInTheDocument();
-    });
+    expect(await screen.findByPlaceholderText(/search/i)).toBeInTheDocument();
   });
autogpt_platform/frontend/src/tests/integrations/helpers/supress-react-query-update-warning.ts (1)

7-12: Add explicit parentheses for readability.

While JavaScript's operator precedence makes && bind tighter than ||, explicit parentheses improve clarity for readers:

Proposed change
      const isActWarning = args.some(
        (arg) =>
          typeof arg === "string" &&
-          (arg.includes("not wrapped in act(...)") ||
-            arg.includes("An update to") && arg.includes("inside a test"))
+          (arg.includes("not wrapped in act(...)") ||
+            (arg.includes("An update to") && arg.includes("inside a test")))
      );
autogpt_platform/frontend/src/tests/integrations/vitest.setup.tsx (2)

10-15: Consider restructuring the nested afterAll pattern.

Registering afterAll inside beforeAll is valid in Vitest but unconventional. Consider using a module-scoped variable for cleaner lifecycle management:

Alternative structure
+let restoreConsoleError: (() => void) | null = null;
+
 beforeAll(() => {
   mockNextjsModules();
   mockSupabaseRequest();
-  const restoreConsoleError = suppressReactQueryUpdateWarning();
-  afterAll(() => {
-    restoreConsoleError();
-  });
-  return server.listen({ onUnhandledRequest: "error" });
+  restoreConsoleError = suppressReactQueryUpdateWarning();
+  server.listen({ onUnhandledRequest: "error" });
 });
+
 afterEach(() => { server.resetHandlers(); });
-afterAll(() => server.close());
+afterAll(() => {
+  restoreConsoleError?.();
+  server.close();
+});

17-17: Fix formatting inconsistency.

The inline block is missing spaces inside braces.

Proposed change
-afterEach(() => {server.resetHandlers()});
+afterEach(() => { server.resetHandlers(); });
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/rendering.test.tsx (1)

11-25: Prefer findBy queries over waitFor + getBy in integration tests.

This reduces flakiness and simplifies async expectations.

♻️ Suggested update
-    await waitFor(() => {
-      expect(screen.getByText("Results for:")).toBeInTheDocument();
-    });
-    expect(screen.getByText("test-search")).toBeInTheDocument();
+    expect(await screen.findByText("Results for:")).toBeInTheDocument();
+    expect(await screen.findByText("test-search")).toBeInTheDocument();
-    await waitFor(() => {
-      expect(screen.getByPlaceholderText(/search/i)).toBeInTheDocument();
-    });
+    expect(await screen.findByPlaceholderText(/search/i)).toBeInTheDocument();
Based on learnings: Use `findBy...` methods most of the time in integration tests to wait for elements to appear and avoid flaky tests.
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx (1)

17-61: Prefer findBy queries in async error-state assertions.

This reduces flakiness and avoids wrapping getBy in waitFor.

♻️ Suggested update
-    await waitFor(() => {
-      expect(
-        screen.getByText("Failed to load marketplace data", { exact: false }),
-      ).toBeInTheDocument();
-    });
+    expect(
+      await screen.findByText("Failed to load marketplace data", {
+        exact: false,
+      }),
+    ).toBeInTheDocument();
-    await waitFor(() => {
-      expect(
-        screen.getByRole("button", { name: /try again/i }),
-      ).toBeInTheDocument();
-    });
+    expect(
+      await screen.findByRole("button", { name: /try again/i }),
+    ).toBeInTheDocument();
Based on learnings: Use `findBy...` methods most of the time in integration tests to wait for elements to appear and avoid flaky tests.
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx (1)

12-57: Prefer findBy queries for async error assertions.

This trims boilerplate and aligns with integration test guidance.

♻️ Suggested update
-    await waitFor(() => {
-      expect(
-        screen.getByText("Failed to load marketplace data", { exact: false }),
-      ).toBeInTheDocument();
-    });
+    expect(
+      await screen.findByText("Failed to load marketplace data", {
+        exact: false,
+      }),
+    ).toBeInTheDocument();
-    await waitFor(() => {
-      expect(
-        screen.getByRole("button", { name: /try again/i }),
-      ).toBeInTheDocument();
-    });
+    expect(
+      await screen.findByRole("button", { name: /try again/i }),
+    ).toBeInTheDocument();
Based on learnings: Use `findBy...` methods most of the time in integration tests to wait for elements to appear and avoid flaky tests.
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/empty-state.test.tsx (1)

25-26: Drop non-essential inline comments in tests.

These comments restate the assertions and aren’t needed.

♻️ Suggested cleanup
-    // Page should still render without crashing
     expect(
       await screen.findByText("Featured creators", { exact: false }),
     ).toBeInTheDocument();
@@
-    // Page should still render without crashing
     expect(
       await screen.findByText("Featured agents", { exact: false }),
     ).toBeInTheDocument();
@@
-    // Page should still render the search bar
     expect(
       await screen.findByPlaceholderText(/search/i),
     ).toBeInTheDocument();

As per coding guidelines: Avoid comments at all times unless the code is very complex.

Also applies to: 48-49, 82-83

autogpt_platform/frontend/src/tests/integrations/helpers/create-500-handler.ts (1)

5-8: Allow non-object JSON bodies for error mocks.

Record<string, unknown> blocks arrays or string bodies. Widening to unknown keeps the helper flexible.

♻️ Suggested change
 interface Create500HandlerOptions {
   delayMs?: number;
-  body?: Record<string, unknown>;
+  body?: unknown;
 }
autogpt_platform/frontend/src/tests/integrations/helpers/mock-onboarding-provider.tsx (1)

28-29: Use a local Props interface for MockOnboardingProvider.

Keeps prop typing consistent with frontend standards.

♻️ Suggested refactor
-export function MockOnboardingProvider({ children }: { children: ReactNode }) {
+interface Props {
+  children: ReactNode;
+}
+
+export function MockOnboardingProvider({ children }: Props) {

As per coding guidelines: Component props should use interface Props { ... } (not exported) unless the interface needs to be used outside the component.

autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx (1)

9-10: Remove non-essential inline comments.

They restate what the assertions already convey.

♻️ Suggested cleanup
-    // Override handlers to add delay to simulate loading
     server.use(
@@
-    // Check for loading skeleton elements (animated pulse elements)
     const loadingElements = container.querySelectorAll('[class*="animate-pulse"]');

As per coding guidelines: Avoid comments at all times unless the code is very complex.

Also applies to: 39-40

autogpt_platform/frontend/src/tests/integrations/helpers/mock-supabase-auth.ts (1)

17-21: Reset validation flags to avoid state leakage across tests.

If a prior test sets isValidating, these helpers won’t clear it. Explicitly resetting keeps auth state deterministic.

♻️ Suggested change
   useSupabaseStore.setState({
     user: mergedUser,
     isUserLoading: false,
     hasLoadedUser: true,
+    isValidating: false,
   });
@@
   useSupabaseStore.setState({
     user: null,
     isUserLoading: false,
     hasLoadedUser: true,
+    isValidating: false,
   });
@@
   useSupabaseStore.setState({
     user: null,
     isUserLoading: true,
     hasLoadedUser: false,
+    isValidating: false,
   });

Also applies to: 27-31, 35-39

autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/auth-state.test.tsx (2)

10-13: Minor: Consider simplifying the type assertion.

The sort: undefined as undefined type assertion is redundant. If the prop is optional, you can simply omit it or use sort: undefined.

Suggested simplification
 const defaultProps = {
   searchTerm: "test-search",
-  sort: undefined as undefined,
+  sort: undefined,
 };

20-36: Consider using findByText for cleaner async assertions.

Per testing guidelines, findBy... methods are preferred in integration tests as they combine waiting and querying. This simplifies the code:

Suggested refactor
   test("renders page correctly when logged out", async () => {
     mockUnauthenticatedUser();
     render(<MainSearchResultPage {...defaultProps} />);

-    await waitFor(() => {
-      expect(screen.getByText("Results for:")).toBeInTheDocument();
-    });
+    expect(await screen.findByText("Results for:")).toBeInTheDocument();
   });

   test("renders page correctly when logged in", async () => {
     mockAuthenticatedUser();
     render(<MainSearchResultPage {...defaultProps} />);

-    await waitFor(() => {
-      expect(screen.getByText("Results for:")).toBeInTheDocument();
-    });
+    expect(await screen.findByText("Results for:")).toBeInTheDocument();
   });

Based on learnings: "Use findBy... methods most of the time in integration tests to wait for elements to appear and avoid flaky tests".

autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx (1)

10-15: Minor: Test name could better match the assertion.

The test is named "renders creator info card" but asserts on creator-description. Consider aligning the test name with what's being verified, or expanding the assertions to include the info card specifically.

Option: Rename for clarity
-  test("renders creator info card", async () => {
+  test("renders creator description", async () => {
     render(<MainCreatorPage params={defaultParams} />);
     await waitFor(() => {
       expect(screen.getByTestId("creator-description")).toBeInTheDocument();
     });
   });
autogpt_platform/frontend/src/tests/CLAUDE.md (1)

256-259: Example missing afterEach import.

The example shows afterEach usage but doesn't include it in the imports. Consider adding it for completeness:

Suggested fix
+import { describe, test, afterEach } from "vitest";
 import {
   mockAuthenticatedUser,
   mockUnauthenticatedUser,
   resetAuthState,
 } from "@/tests/integrations/helpers/mock-supabase-auth";

 describe("MyComponent", () => {
   afterEach(() => {

@Abhi1992002 Abhi1992002 requested a review from 0ubbe January 30, 2026 06:32
@0ubbe
Copy link
Contributor

0ubbe commented Feb 12, 2026

@claude can you rebase this PR , fix the lint + address the coderabbit AI suggestions ?

@claude
Copy link
Contributor

claude bot commented Feb 12, 2026

Claude finished @0ubbe's task in 8m 51s β€”β€” View job


Addressed CodeRabbit Suggestions & Fixed Lint

  • Rebase onto dev β€” I'm unable to perform git rebase operations due to tool limitations. Please rebase manually with git rebase origin/dev. More info in the FAQ.
  • Fix filename typo: supress β†’ suppress and update imports
  • Replace waitFor + getByText/getByRole with findByText/findByRole across 8 test files (idiomatic RTL async queries)
  • Extract inline props to interface Props in mock-onboarding-provider.tsx
  • Remove unnecessary comments in test files (empty-state, loading-state, no-results)
  • Fix operator precedence with explicit parentheses in suppress helper
  • Remove redundant undefined as undefined type casts (4 files)
  • Fix loading-state test to wrap assertion in waitFor for robustness
  • Clean up vitest.setup.tsx (nested afterAll β†’ module-scoped variable, formatting)
  • Widen body type in create-500-handler.ts (Record<string, unknown> β†’ unknown)
  • Reset isValidating flag in mock-supabase-auth.ts (all 3 functions)
  • Rename test "search bar remains functional" β†’ "search bar is present" (accuracy)
  • Rename test "renders creator info card" β†’ "renders creator description" (accuracy)
  • Add missing creators MSW handler in no-results tests for consistency
  • Fix lint errors: unused imports (act, matchesUrl) and unused params (step, completeStep)
  • Fix formatting in custom-mutator.ts (indentation)
  • Push changes

Not addressed:

  • UserOnboarding import: The __generated__/models/ directory doesn't exist on this branch, so the UserOnboarding import from @/lib/autogpt-server-api cannot be replaced with the generated type. This can be addressed after running pnpm generate:api or after rebasing onto dev.
  • Rebase: Git rebase is outside my capabilities. Please run git rebase origin/dev manually.
    |

…tests

- Fix filename typo: supress β†’ suppress and update imports
- Replace waitFor + getByText/getByRole with findByText/findByRole (idiomatic RTL async queries)
- Remove unnecessary comments in test files per coding guidelines
- Fix operator precedence with explicit parentheses in suppress helper
- Remove redundant `undefined as undefined` type casts
- Extract inline props to `interface Props` in MockOnboardingProvider
- Widen body type in create-500-handler from Record<string,unknown> to unknown
- Add isValidating reset in mock-supabase-auth helpers
- Add missing creators MSW handler in no-results tests
- Clean up vitest.setup.tsx: replace nested afterAll with module-scoped variable
- Fix lint errors: unused imports (act, matchesUrl) and unused params
- Fix formatting in custom-mutator.ts

Co-authored-by: Ubbe <[email protected]>
Copy link
Contributor

@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: 1

πŸ€– Fix all issues with AI agents
In
`@autogpt_platform/frontend/src/app/`(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx:
- Around line 11-14: Update the test's defaultProps to use a valid
MarketplaceSearchSort value instead of undefined: change the sort property in
defaultProps used by MainSearchResultPage tests to match the production default
("runs") as in search/page.tsx so it satisfies the non-optional
MarketplaceSearchSort type under strict mode; locate defaultProps in
error-handling.test.tsx and set sort to "runs" (or any valid enum/member of
MarketplaceSearchSort) to fix the type error.
🧹 Nitpick comments (2)
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx (1)

36-46: Consider also overriding the creators endpoint for the 500 test.

This test only overrides */api/store/agents* with a 500 response. It works because the hook's hasError triggers when any endpoint fails, but the test name ("when API returns 500") implies broader coverage. For completeness and resilience against future refactors of the error logic, consider also adding a 500 handler for the creators endpointβ€”or narrowing the test name to "when agents API returns 500."

autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts (1)

24-25: Remove redundant navigation after login.

hasUrl(page, "/marketplace") asserts the login already redirected to /marketplace. The subsequent marketplacePage.goto(page) navigates to the same URL again and waits for network idle, adding unnecessary latency. Since the page is already at the correct URL after login, the goto() call can be removed.

πŸ“œ Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 0fcaa63 and caabee9.

πŸ“’ Files selected for processing (17)
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/empty-state.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/auth-state.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/no-results.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/api/mutators/custom-mutator.ts
  • autogpt_platform/frontend/src/tests/integrations/helpers/create-500-handler.ts
  • autogpt_platform/frontend/src/tests/integrations/helpers/mock-onboarding-provider.tsx
  • autogpt_platform/frontend/src/tests/integrations/helpers/mock-supabase-auth.ts
  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
  • autogpt_platform/frontend/src/tests/integrations/test-utils.tsx
  • autogpt_platform/frontend/src/tests/integrations/vitest.setup.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
🚧 Files skipped from review as they are similar to previous changes (11)
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/tests/no-results.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/tests/empty-state.test.tsx
  • autogpt_platform/frontend/src/app/api/mutators/custom-mutator.ts
  • autogpt_platform/frontend/src/tests/integrations/helpers/create-500-handler.ts
  • autogpt_platform/frontend/src/tests/integrations/helpers/mock-supabase-auth.ts
  • autogpt_platform/frontend/src/tests/integrations/test-utils.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/tests/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/tests/auth-state.test.tsx
  • autogpt_platform/frontend/src/tests/integrations/vitest.setup.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/tests/error-handling.test.tsx
  • autogpt_platform/frontend/src/tests/integrations/helpers/mock-onboarding-provider.tsx
🧰 Additional context used
πŸ““ Path-based instructions (13)
autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}

πŸ“„ CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx,js,jsx}: Use Node.js 21+ with pnpm package manager for frontend development
Always run 'pnpm format' for formatting and linting code in frontend development

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
autogpt_platform/frontend/**/*.{tsx,ts}

πŸ“„ CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{tsx,ts}: Use function declarations for components and handlers (not arrow functions) in React components
Only use arrow functions for small inline lambdas (map, filter, etc.) in React components
Use PascalCase for component names and camelCase with 'use' prefix for hook names in React
Use Tailwind CSS utilities only for styling in frontend components
Use design system components from 'src/components/' (atoms, molecules, organisms) in frontend development
Never use 'src/components/legacy/' in frontend code
Only use Phosphor Icons (@phosphor-icons/react) for icons in frontend components
Use generated API hooks from '@/app/api/generated/endpoints/' instead of deprecated 'BackendAPI' or 'src/lib/autogpt-server-api/
'
Use React Query for server state (via generated hooks) in frontend development
Default to client components ('use client') in Next.js; only use server components for SEO or extreme TTFB needs
Use '' component for rendering errors in frontend UI; use toast notifications for mutation errors; use 'Sentry.captureException()' for manual exceptions
Separate render logic from data/behavior in React components; keep comments minimal (code should be self-documenting)

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
autogpt_platform/frontend/**/*.{ts,tsx}

πŸ“„ CodeRabbit inference engine (.github/copilot-instructions.md)

autogpt_platform/frontend/**/*.{ts,tsx}: No barrel files or 'index.ts' re-exports in frontend code
Regenerate API hooks with 'pnpm generate:api' after backend OpenAPI spec changes in frontend development

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
autogpt_platform/frontend/src/**/*.{ts,tsx}

πŸ“„ CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)

autogpt_platform/frontend/src/**/*.{ts,tsx}: Fully capitalize acronyms in symbols, e.g. graphID, useBackendAPI
Use function declarations (not arrow functions) for components and handlers
Separate render logic (.tsx) from business logic (use*.ts hooks)
Use shadcn/ui (Radix UI primitives) with Tailwind CSS styling for UI components
Use Phosphor Icons only for icons
Use ErrorCard for render errors, toast for mutations, and Sentry for exceptions
Use design system components from src/components/ (atoms, molecules, organisms)
Never use src/components/__legacy__/* components
Use generated API hooks from @/app/api/__generated__/endpoints/ with pattern use{Method}{Version}{OperationName}
Use Tailwind CSS only for styling, with design tokens
Do not use useCallback or useMemo unless asked to optimize a given function
Never type with any unless a variable/attribute can ACTUALLY be of any type

autogpt_platform/frontend/src/**/*.{ts,tsx}: Structure components as ComponentName/ComponentName.tsx + useComponentName.ts + helpers.ts and use design system components from src/components/ (atoms, molecules, organisms)
Use generated API hooks from @/app/api/__generated__/endpoints/ with pattern use{Method}{Version}{OperationName} and regenerate with pnpm generate:api
Use function declarations (not arrow functions) for components and handlers
Separate render logic from business logic with component.tsx + useComponent.ts + helpers.ts structure
Colocate state when possible, avoid creating large components, use sub-components in local /components folder
Avoid large hooks, abstract logic into helpers.ts files when sensible
Use arrow functions only for callbacks, not for component declarations
Avoid comments at all times unless the code is very complex
Do not use useCallback or useMemo unless asked to optimize a given function

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
autogpt_platform/frontend/**/*.{test.ts,test.tsx,.stories.tsx}

πŸ“„ CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)

Use Playwright for E2E tests and Storybook for component development

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
autogpt_platform/frontend/src/app/(platform)/**/components/**/*.{ts,tsx}

πŸ“„ CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)

Put sub-components in local components/ folder within feature directories

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
autogpt_platform/frontend/src/**/*.tsx

πŸ“„ CodeRabbit inference engine (autogpt_platform/frontend/CLAUDE.md)

Component props should be type Props = { ... } (not exported) unless it needs to be used outside the component

Component props should be interface Props { ... } (not exported) unless the interface needs to be used outside the component

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}

πŸ“„ CodeRabbit inference engine (AGENTS.md)

autogpt_platform/frontend/**/*.{js,jsx,ts,tsx}: Format frontend code using pnpm format
Never use components from src/components/__legacy__/*

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
autogpt_platform/frontend/**/*.{js,jsx,ts,tsx,css}

πŸ“„ CodeRabbit inference engine (AGENTS.md)

Use Tailwind CSS only for styling, use design tokens, and use Phosphor Icons only

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
autogpt_platform/**/*.{ts,tsx}

πŸ“„ CodeRabbit inference engine (AGENTS.md)

Never type with any, if no types available use unknown

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
autogpt_platform/frontend/**/*.{test,spec}.{ts,tsx}

πŸ“„ CodeRabbit inference engine (AGENTS.md)

Run pnpm test or pnpm test-ui for frontend Playwright tests

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
autogpt_platform/frontend/src/app/(platform)/**/*.tsx

πŸ“„ CodeRabbit inference engine (AGENTS.md)

If adding protected frontend routes, update frontend/lib/supabase/middleware.ts

Files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
autogpt_platform/frontend/src/**/*.ts

πŸ“„ CodeRabbit inference engine (AGENTS.md)

Do not type hook returns, let Typescript infer as much as possible

Files:

  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
🧠 Learnings (21)
πŸ““ Common learnings
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/main.test.tsx : Start integration tests at the page level with a `main.test.tsx` file and split into smaller files as it grows
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for page-level behavior with mocked API responses and components that fetch data
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for user interactions that trigger API calls and feature flows within a single page
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.615Z
Learning: Applies to autogpt_platform/frontend/**/*.stories.tsx : Add Storybook stories for new components and Playwright E2E tests for features
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for component state changes and custom hooks
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Place E2E tests (Playwright) in a centralized location for critical user journeys
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/**/*.stories.{ts,tsx} : Add Storybook stories for new components and Playwright for E2E testing
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for testing pure utility functions and isolated components
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.615Z
Learning: Applies to autogpt_platform/frontend/**/*.{test.ts,test.tsx,.stories.tsx} : Use Playwright for E2E tests and Storybook for component development
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for authentication flows (login, signup, logout) that MUST work in a real browser
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for payment or sensitive transactions requiring a real browser
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for flows requiring real browser APIs (clipboard, downloads) or cross-page navigation
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/main.test.tsx : Start integration tests at the page level with a `main.test.tsx` file and split into smaller files as it grows

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for page-level behavior with mocked API responses and components that fetch data

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Place E2E tests (Playwright) in a centralized location for critical user journeys

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use integration tests (Vitest + RTL) for user interactions that trigger API calls and feature flows within a single page

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for component state changes and custom hooks

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Use unit tests (Vitest + RTL) for testing pure utility functions and isolated components

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Mock API requests in integration tests via MSW (Mock Service Worker)

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
πŸ“š Learning: 2026-02-04T16:50:33.615Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.615Z
Learning: Applies to autogpt_platform/frontend/**/*.stories.tsx : Add Storybook stories for new components and Playwright E2E tests for features

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for flows requiring real browser APIs (clipboard, downloads) or cross-page navigation

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
πŸ“š Learning: 2026-02-04T16:50:51.495Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-02-04T16:50:51.495Z
Learning: Applies to autogpt_platform/frontend/**/*.stories.{ts,tsx} : Add Storybook stories for new components and Playwright for E2E testing

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/__tests__/*.test.{tsx,ts} : Use `findBy...` methods most of the time in integration tests to wait for elements to appear and avoid flaky tests

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
πŸ“š Learning: 2026-02-04T16:50:33.615Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/CLAUDE.md:0-0
Timestamp: 2026-02-04T16:50:33.615Z
Learning: Applies to autogpt_platform/frontend/**/*.{test.ts,test.tsx,.stories.tsx} : Use Playwright for E2E tests and Storybook for component development

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.stories.tsx : Place Storybook visual tests co-located: `Component.stories.tsx` next to `Component.tsx`

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.stories.tsx : Use Storybook for design system, atoms, molecules, visual states (hover, disabled, loading), and responsive layouts

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/**/*.test.{tsx,ts} : Place unit tests co-located with the source file: `Component.test.tsx` next to `Component.tsx`

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Do not test CSS styling details; use Storybook instead

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for payment or sensitive transactions requiring a real browser

Applied to files:

  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx
  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
  • autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Applies to autogpt_platform/frontend/src/tests/src/tests/**/*.spec.ts : Use E2E tests (Playwright) for authentication flows (login, signup, logout) that MUST work in a real browser

Applied to files:

  • autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts
πŸ“š Learning: 2026-02-04T16:49:42.490Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2026-02-04T16:49:42.490Z
Learning: Applies to autogpt_platform/frontend/**/*.{tsx,ts} : Use React Query for server state (via generated hooks) in frontend development

Applied to files:

  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
πŸ“š Learning: 2026-01-28T18:29:34.362Z
Learnt from: CR
Repo: Significant-Gravitas/AutoGPT PR: 0
File: autogpt_platform/frontend/src/tests/CLAUDE.md:0-0
Timestamp: 2026-01-28T18:29:34.362Z
Learning: Do not test third-party library internals (Radix UI, React Query)

Applied to files:

  • autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts
🧬 Code graph analysis (3)
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx (3)
autogpt_platform/frontend/src/components/molecules/ErrorBoundary/ErrorBoundary.tsx (1)
  • render (53-77)
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/MainSearchResultPage.tsx (1)
  • MainSearchResultPage (14-116)
autogpt_platform/frontend/src/tests/integrations/helpers/create-500-handler.ts (1)
  • create500Handler (10-31)
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx (2)
autogpt_platform/frontend/src/components/molecules/ErrorBoundary/ErrorBoundary.tsx (1)
  • render (53-77)
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/MainMarketplacePage.tsx (1)
  • MainMarkeplacePage (12-65)
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx (3)
autogpt_platform/frontend/src/components/molecules/ErrorBoundary/ErrorBoundary.tsx (1)
  • render (53-77)
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/MainMarketplacePage.tsx (1)
  • MainMarkeplacePage (12-65)
autogpt_platform/frontend/src/tests/integrations/helpers/create-500-handler.ts (1)
  • create500Handler (10-31)
πŸ”‡ Additional comments (10)
autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainCreatorPage/__tests__/rendering.test.tsx (1)

1-37: Clean, well-structured rendering tests.

Good use of findBy* async queries throughout, which avoids flaky tests by properly waiting for elements to appear after data fetching. The test structure aligns well with the project's integration testing conventions (Vitest + RTL for page-level behavior).

autogpt_platform/frontend/src/tests/integrations/helpers/suppress-react-query-update-warning.ts (1)

1-34: Clean test helper β€” LGTM.

The save/filter/restore pattern is correct. Using unknown[] instead of any[] aligns with the project's typing guidelines, and the two-phase check (act warning β†’ React Query related) avoids accidentally swallowing unrelated errors.

autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/loading-state.test.tsx (1)

1-5: LGTM! Imports are appropriate β€” Vitest + RTL + MSW aligns with the project's integration test conventions.

autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainMarketplacePage/__tests__/error-handling.test.tsx (3)

1-9: LGTM on imports and test setup.

Good use of generated MSW handlers (getGetV2ListStoreAgentsMockHandler422, getGetV2ListStoreCreatorsMockHandler422) alongside the custom create500Handler helper. This aligns well with the project's approach of mocking API requests via MSW in integration tests. Based on learnings: "Mock API requests in integration tests via MSW (Mock Service Worker)."


12-46: Good use of findByText for async assertions.

All three error-scenario tests correctly use findByText to wait for the error message to appear, avoiding flaky waitFor + getByText patterns. Based on learnings: "Use findBy... methods most of the time in integration tests to wait for elements to appear and avoid flaky tests."


48-56: Retry button visibility test looks correct.

Properly verifies the "Try again" button rendered by ErrorCard via onRetry in the component. Using findByRole with accessible name matching is a solid RTL pattern.

autogpt_platform/frontend/src/tests/marketplace-agent.spec.ts (1)

12-48: Well-structured cross-page E2E flow.

The test appropriately covers a critical user journey (login β†’ marketplace β†’ add agent to library β†’ verify in library) using Playwright, which aligns with the project's testing guidelines for cross-page navigation flows. The defensive title check and regex escaping are good practices.

autogpt_platform/frontend/src/app/(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx (3)

16-39: Good error isolation testing.

Each test correctly mocks only one failing endpoint to verify that a single API failure triggers the error UI. The use of findByText for async assertions follows best practices.


53-61: LGTM!

Good use of findByRole with accessible name matching for the retry button assertion.


41-51: No changes needed. The glob pattern */api/store/agents* correctly matches the actual endpoint path /api/store/agents, and generated 500 handlers do not exist as an alternativeβ€”only 422 handlers are generated. The glob pattern is the appropriate approach here and is consistently used across all marketplace test files.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +11 to +14
const defaultProps = {
searchTerm: "test-search",
sort: undefined,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟑 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find MarketplaceSearchSort type definition
rg -n "type MarketplaceSearchSort\|interface MarketplaceSearchSort" --type=ts --type=tsx -C 5

Repository: Significant-Gravitas/AutoGPT

Length of output: 99


🏁 Script executed:

#!/bin/bash
# Find MainSearchResultPage component and its Props
rg -n "MainSearchResultPage" --type=tsx -C 3 | head -60

Repository: Significant-Gravitas/AutoGPT

Length of output: 99


🏁 Script executed:

#!/bin/bash
# Check the test file to see the full context and understand what sort should be
cat -n autogpt_platform/frontend/src/app/\(platform\)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx

Repository: Significant-Gravitas/AutoGPT

Length of output: 2372


🏁 Script executed:

#!/bin/bash
# Find where MainSearchResultPage component is defined (Props interface)
fd -e tsx MainSearchResultPage.tsx | head -5

Repository: Significant-Gravitas/AutoGPT

Length of output: 185


🏁 Script executed:

#!/bin/bash
# Read the MainSearchResultPage component to see Props
cat autogpt_platform/frontend/src/app/\(platform\)/marketplace/components/MainSearchResultPage/MainSearchResultPage.tsx

Repository: Significant-Gravitas/AutoGPT

Length of output: 4058


🏁 Script executed:

#!/bin/bash
# Search for MarketplaceSearchSort type definition
rg "MarketplaceSearchSort" --type ts | head -20

Repository: Significant-Gravitas/AutoGPT

Length of output: 981


🏁 Script executed:

#!/bin/bash
# Find GetV2ListStoreAgentsParams type to understand sorted_by
rg "GetV2ListStoreAgentsParams" --type ts -A 10 | head -50

Repository: Significant-Gravitas/AutoGPT

Length of output: 5741


🏁 Script executed:

#!/bin/bash
# Look for the generated API models file
fd "getV2ListStoreAgentsParams" --type ts

Repository: Significant-Gravitas/AutoGPT

Length of output: 241


🏁 Script executed:

#!/bin/bash
# Find the generated API models file
find . -name "*getV2ListStoreAgentsParams*" -type f

Repository: Significant-Gravitas/AutoGPT

Length of output: 54


🏁 Script executed:

#!/bin/bash
# Read the generated models file
cat autogpt_platform/frontend/src/app/api/__generated__/models/getV2ListStoreAgentsParams.ts

Repository: Significant-Gravitas/AutoGPT

Length of output: 192


🏁 Script executed:

#!/bin/bash
# Find all files in the generated folder
find autogpt_platform/frontend/src/app/api/__generated__ -type f | grep -i "agent\|param" | head -20

Repository: Significant-Gravitas/AutoGPT

Length of output: 158


🏁 Script executed:

#!/bin/bash
# List the structure of the generated folder
tree -L 3 autogpt_platform/frontend/src/app/api/__generated__/ 2>/dev/null || find autogpt_platform/frontend/src/app/api/__generated__/ -type f | head -20

Repository: Significant-Gravitas/AutoGPT

Length of output: 274


🏁 Script executed:

#!/bin/bash
# List frontend directory structure
ls -la autogpt_platform/frontend/src/app/

Repository: Significant-Gravitas/AutoGPT

Length of output: 735


🏁 Script executed:

#!/bin/bash
# Search for where GetV2ListStoreAgentsParams is defined
rg "export.*GetV2ListStoreAgentsParams" --type ts

Repository: Significant-Gravitas/AutoGPT

Length of output: 54


🏁 Script executed:

#!/bin/bash
# Search for GetV2ListStoreAgentsParams definition anywhere in the codebase
rg "GetV2ListStoreAgentsParams" --type ts -B 5 | head -40

Repository: Significant-Gravitas/AutoGPT

Length of output: 4238


🏁 Script executed:

#!/bin/bash
# Check if it's imported from node_modules
rg "GetV2ListStoreAgentsParams" | head -20

Repository: Significant-Gravitas/AutoGPT

Length of output: 1199


🏁 Script executed:

#!/bin/bash
# Check if the models are in node_modules
find . -path "*/node_modules/*getV2ListStoreAgentsParams*" 2>/dev/null | head -5

Repository: Significant-Gravitas/AutoGPT

Length of output: 54


🏁 Script executed:

#!/bin/bash
# Look at what's in the api directory
ls -la autogpt_platform/frontend/src/app/api/

Repository: Significant-Gravitas/AutoGPT

Length of output: 669


🏁 Script executed:

#!/bin/bash
# Check package.json for any generation scripts
rg "generate:api|openapi" autogpt_platform/frontend/package.json

Repository: Significant-Gravitas/AutoGPT

Length of output: 360


🏁 Script executed:

#!/bin/bash
# Check the openapi.json for the store agents endpoint parameters
rg "ListStoreAgents|sorted_by" autogpt_platform/frontend/src/app/api/openapi.json | head -30

Repository: Significant-Gravitas/AutoGPT

Length of output: 1554


🏁 Script executed:

#!/bin/bash
# Search more specifically in openapi.json for the parameters
jq '.paths."/api/v2/store/agents"' autogpt_platform/frontend/src/app/api/openapi.json 2>/dev/null | head -100

Repository: Significant-Gravitas/AutoGPT

Length of output: 76


🏁 Script executed:

#!/bin/bash
# Extract the sorted_by parameter definition from openapi.json
jq '.components.parameters | to_entries[] | select(.value.name == "sorted_by")' autogpt_platform/frontend/src/app/api/openapi.json 2>/dev/null

Repository: Significant-Gravitas/AutoGPT

Length of output: 54


🏁 Script executed:

#!/bin/bash
# Look for schema definitions related to GetV2ListStoreAgentsParams
jq '.components.schemas | keys[] | select(contains("GetV2ListStoreAgentsParams") or contains("ListStoreAgents"))' autogpt_platform/frontend/src/app/api/openapi.json 2>/dev/null

Repository: Significant-Gravitas/AutoGPT

Length of output: 54


🏁 Script executed:

#!/bin/bash
# Search for any TypeScript compilation or test results
find . -name "*.d.ts" -path "*store*" -o -name "*.ts" -path "*generated*" 2>/dev/null | head -20

Repository: Significant-Gravitas/AutoGPT

Length of output: 54


🏁 Script executed:

#!/bin/bash
# Check the orval config to understand how types are generated
cat autogpt_platform/frontend/orval.config.ts 2>/dev/null || cat autogpt_platform/frontend/orval.config.js 2>/dev/null

Repository: Significant-Gravitas/AutoGPT

Length of output: 3127


🏁 Script executed:

#!/bin/bash
# Check if there's a tsconfig that might affect type strictness
cat autogpt_platform/frontend/tsconfig.json

Repository: Significant-Gravitas/AutoGPT

Length of output: 771


🏁 Script executed:

#!/bin/bash
# Look at the search page to see what sort value it passes when sort is defined
cat -n autogpt_platform/frontend/src/app/\(platform\)/marketplace/search/page.tsx

Repository: Significant-Gravitas/AutoGPT

Length of output: 941


🏁 Script executed:

#!/bin/bash
# Check how useMainSearchResultPage uses the sort parameter
cat autogpt_platform/frontend/src/app/\(platform\)/marketplace/components/MainSearchResultPage/useMainSearchResultPage.ts | head -80

Repository: Significant-Gravitas/AutoGPT

Length of output: 2404


🏁 Script executed:

#!/bin/bash
# Check if there's a package.json script to run type checking
rg "tsc|typecheck" autogpt_platform/frontend/package.json

Repository: Significant-Gravitas/AutoGPT

Length of output: 136


Use a valid sort value in defaultProps instead of undefined.

The MainSearchResultPage component requires sort: MarketplaceSearchSort (non-optional). With TypeScript strict mode enabled ("strict": true in tsconfig.json), passing undefined violates the type contract. Production code in search/page.tsx defaults to "runs" when sort is not provided; the test should follow the same pattern for consistency and type safety.

const defaultProps = {
  searchTerm: "test-search",
- sort: undefined,
+ sort: "runs",
};
πŸ€– Prompt for AI Agents
In
`@autogpt_platform/frontend/src/app/`(platform)/marketplace/components/MainSearchResultPage/__tests__/error-handling.test.tsx
around lines 11 - 14, Update the test's defaultProps to use a valid
MarketplaceSearchSort value instead of undefined: change the sort property in
defaultProps used by MainSearchResultPage tests to match the production default
("runs") as in search/page.tsx so it satisfies the non-optional
MarketplaceSearchSort type under strict mode; locate defaultProps in
error-handling.test.tsx and set sort to "runs" (or any valid enum/member of
MarketplaceSearchSort) to fix the type error.

@0ubbe
Copy link
Contributor

0ubbe commented Feb 12, 2026

@claude address latest coderabbit ai suggestion

@claude
Copy link
Contributor

claude bot commented Feb 12, 2026

Claude finished @0ubbe's task in 2m 4s β€”β€” View job


Addressed Latest CodeRabbit AI Suggestions

  • Fix sort prop in MainSearchResultPage test files β€” use "runs" instead of undefined to match production default and satisfy the non-optional MarketplaceSearchSort type
  • Remove redundant marketplacePage.goto(page) navigation in marketplace-agent E2E test (page is already at /marketplace after login)
  • Push changes

Files changed:

  • MainSearchResultPage/__tests__/error-handling.test.tsx β€” sort: "runs" as const
  • MainSearchResultPage/__tests__/auth-state.test.tsx β€” sort: "runs" as const
  • MainSearchResultPage/__tests__/no-results.test.tsx β€” sort: "runs" as const
  • MainSearchResultPage/__tests__/rendering.test.tsx β€” sort: "runs" as const
  • marketplace-agent.spec.ts β€” removed redundant goto() call

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

Labels

platform/frontend AutoGPT Platform - Front end size/xl

Projects

Status: πŸ†• Needs initial review
Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants