Skip to content

fixed:Postgres Migration Support for User Portal #3730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

gkbishnoi07
Copy link

@gkbishnoi07 gkbishnoi07 commented Feb 22, 2025

What kind of change does this PR introduce?

feature

Issue Number:

Fixes #3565

Snapshots/Videos:

before
before

after
Screenshot 2025-02-22 181147

Summary

used userJoinedOrganizations to fetch organizations in the user portal

Does this PR introduce a breaking change?
no

Checklist

CodeRabbit AI Review

  • I have reviewed and addressed all critical issues flagged by CodeRabbit AI
  • I have implemented or provided justification for each non-critical suggestion
  • I have documented my reasoning in the PR comments where CodeRabbit AI suggestions were not implemented

Test Coverage

  • I have written tests for all new changes/features
  • I have verified that test coverage meets or exceeds 95%
  • I have run the test suite locally and all tests pass

Other information

Have you read the contributing guide?

Summary by CodeRabbit

  • New Features

    • Introduced a new GraphQL query for fetching joined organizations.
    • Enhanced search functionality to filter organizations based on user input.
  • Bug Fixes

    • Improved handling of organization data to align with the updated GraphQL schema.
    • Enhanced processing of membership status for a more accurate view of user memberships.
  • Tests

    • Added new tests for the search functionality and organization data handling, covering various scenarios and edge cases.

Copy link

Our Pull Request Approval Process

Thanks for contributing!

Testing Your Code

Remember, your PRs won't be reviewed until these criteria are met:

  1. We don't merge PRs with poor code quality.
    1. Follow coding best practices such that CodeRabbit.ai approves your PR.
  2. We don't merge PRs with failed tests.
    1. When tests fail, click on the Details link to learn more.
    2. Write sufficient tests for your changes (CodeCov Patch Test). Your testing level must be better than the target threshold of the repository
    3. Tests may fail if you edit sensitive files. Ask to add the ignore-sensitive-files-pr label if the edits are necessary.
  3. We cannot merge PRs with conflicting files. These must be fixed.

Our policies make our code better.

Reviewers

Do not assign reviewers. Our Queue Monitors will review your PR and assign them.
When your PR has been assigned reviewers contact them to get your code reviewed and approved via:

  1. comments in this PR or
  2. our slack channel

Reviewing Your Code

Your reviewer(s) will have the following roles:

  1. arbitrators of future discussions with other contributors about the validity of your changes
  2. point of contact for evaluating the validity of your work
  3. person who verifies matching issues by others that should be closed.
  4. person who gives general guidance in fixing your tests

CONTRIBUTING.md

Read our CONTRIBUTING.md file. Most importantly:

  1. PRs with issues not assigned to you will be closed by the reviewer
  2. Fix the first comment in the PR so that each issue listed automatically closes

Other

  1. 🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
  2. Read the CONTRIBUTING.md file make

Copy link
Contributor

coderabbitai bot commented Feb 22, 2025

Walkthrough

The pull request updates the Organizations.tsx file by modifying GraphQL query usage and associated data processing. The GraphQL query identifier is changed and its parameters are updated. The mapping logic for organization data is revised to adapt to the new schema, including adjustments in membership request handling and how organization membership is checked within a secondary effect. Additionally, the test file Organizations.spec.tsx is updated to include mock responses and tests for the new query.

Changes

File Change Summary
src/screens/UserPortal/Organizations/Organizations.tsx - Updated GraphQL query identifier from USER_ORGANIZATION_CONNECTION to USER_JOINED_ORGANIZATIONS_PG
- Revised query parameters from filter (using filterName) to id and first (derived from userId and rowsPerPage)
- Changed mapping from data.organizationsConnection to data?.UserJoinedOrganizations
- Updated membership request and member checks in the second useEffect using some instead of find
src/screens/UserPortal/Organizations/Organizations.spec.tsx - Introduced new GraphQL query USER_JOINED_ORGANIZATIONS_PG
- Added mock responses for filtered and unfiltered searches
- Updated test logic for search functionality and rendering of the "Join Now" button

Possibly related PRs

  • Refactor:Vitest to src/screens/OrganizationPeople #2663: The changes in the main PR are related to the introduction of the USER_JOINED_ORGANIZATIONS_PG query, which is also referenced in the test modifications of the retrieved PR, indicating a direct connection in terms of functionality being tested.
  • pagination and placeholder 2117 #2297: The changes in the main PR are related to the modifications in the Organizations.tsx file, specifically the update of the search placeholder from searchUsers to searchOrganizations, which aligns with the new translation entry for searching organizations in the retrieved PR.
  • refactor:vitest to src/screens/UserPortal/Organizations #2783: The changes in the main PR are related to the modifications in the test cases for the USER_JOINED_ORGANIZATIONS_PG query in the retrieved PR, as both involve updates to the handling and testing of organization data in the Organizations.spec.tsx file.

Suggested labels

ignore-sensitive-files-pr

Suggested reviewers

  • palisadoes
  • disha1202

Poem

I'm a hopping rabbit celebrating code so neat,
From queries to data flows, everything's in sync and sweet.
My whiskers twitch at each new line that shines,
GraphQL carrots crunch as the app aligns.
Hoppity, happy in a code garden divine!
🐇✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6bf8a09 and 708bd65.

📒 Files selected for processing (2)
  • src/screens/UserPortal/Organizations/Organizations.spec.tsx (6 hunks)
  • src/screens/UserPortal/Organizations/Organizations.tsx (7 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Test Application
  • GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (9)
src/screens/UserPortal/Organizations/Organizations.tsx (5)

7-7: LGTM! Query setup is correct.

The new query USER_JOINED_ORGANIZATIONS_PG is properly configured with all necessary variables (id, first, filter) for pagination and search functionality.

Also applies to: 143-144


128-128: LGTM! Removed unnecessary initial value.

The initial value for filterName state is not needed as it's only used in the handleSearch function.


230-231: LGTM! Data mapping is correctly updated.

The mapping function correctly handles the new data structure, transitioning from a connection-based to a direct array-based approach.


258-284: LGTM! Edge/node data structure handling is robust.

The code correctly processes the edge/node data structure with proper null checks and array type validations. The membership status checks are well-implemented.


288-303: LGTM! Data access paths are correctly updated.

The code properly handles the updated data structure for joined and created organizations with robust optional chaining.

src/screens/UserPortal/Organizations/Organizations.spec.tsx (4)

321-479: LGTM! Mock data is comprehensive.

The mock data for USER_JOINED_ORGANIZATIONS_PG query is well-structured and covers all necessary scenarios including initial load, search, and empty search cases.


594-628: LGTM! Search functionality test is thorough.

The test case comprehensively covers search functionality with explicit steps, multiple search triggers (button click and keyboard enter), and proper result verification.


701-711: LGTM! Join button test is well-structured.

The test properly handles asynchronous operations with waitFor and correctly verifies the presence and count of join buttons.


839-933: LGTM! Edge/node data structure test is comprehensive.

The test suite thoroughly verifies the handling of edge/node data structure with proper loading state checks and appropriate timeouts for async operations.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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

🔭 Outside diff range comments (2)
src/screens/UserPortal/Organizations/Organizations.tsx (2)

193-199: ⚠️ Potential issue

Update search functionality to match new pagination model.

The search functionality still uses the old filter-based approach (refetch({ filter: value })), but the query has been updated to use cursor-based pagination with id and first parameters. This mismatch could cause issues.

Update the search handler to match the new query structure:

 const handleSearch = (value: string): void => {
   setFilterName(value);
 
   refetch({
-    filter: value,
+    id: userId,
+    first: rowsPerPage,
+    searchText: value,
   });
 };

228-251: 🛠️ Refactor suggestion

Refactor duplicate membership status logic.

The membership status checking logic is duplicated between the two useEffect hooks. This violates the DRY principle and makes maintenance harder.

Extract the common logic into a reusable function:

const getMembershipStatus = (organization: InterfaceOrganization, userId: string): string => {
  if (Array.isArray(organization.members) && 
      organization.members.some(member => member._id === userId)) {
    return 'accepted';
  }
  
  if (organization.membershipRequests?.some(
      request => request.user._id === userId)) {
    return 'pending';
  }
  
  return '';
};

Then use this function in both effects:

// In first useEffect
return { 
  ...organization, 
  membershipRequestStatus: getMembershipStatus(organization, userId) 
};

// In second useEffect
return {
  ...organization,
  membershipRequestStatus: getMembershipStatus(organization, userId),
  isJoined: false,
};

Also applies to: 256-315

🧹 Nitpick comments (1)
src/screens/UserPortal/Organizations/Organizations.tsx (1)

287-314: Simplify nested conditionals in mode handling.

The mode handling logic uses deeply nested conditionals which make the code harder to read and maintain.

Consider using early returns or a switch statement:

const getOrganizationsByMode = (mode: number) => {
  switch (mode) {
    case 1:
      return joinedOrganizationsData?.users?.[0]?.user?.joinedOrganizations?.map(
        (org: InterfaceOrganization) => ({
          ...org,
          membershipRequestStatus: 'accepted',
          isJoined: true,
        })
      ) || [];
      
    case 2:
      return createdOrganizationsData?.users?.[0]?.appUserProfile?.createdOrganizations?.map(
        (org: InterfaceOrganization) => ({
          ...org,
          membershipRequestStatus: 'accepted',
          isJoined: true,
        })
      ) || [];
      
    default:
      return data?.user?.organizationsWhereMember?.edges?.map(
        (edge: { node: InterfaceOrganization }) => ({
          ...edge.node,
          membershipRequestStatus: getMembershipStatus(edge.node, userId),
          isJoined: false,
        })
      ) || [];
  }
};

// In useEffect
setOrganizations(getOrganizationsByMode(mode));
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3168b8b and f282775.

📒 Files selected for processing (1)
  • src/screens/UserPortal/Organizations/Organizations.tsx (7 hunks)
🔇 Additional comments (1)
src/screens/UserPortal/Organizations/Organizations.tsx (1)

6-8: LGTM! Import changes align with Postgres migration.

The addition of USER_JOINED_ORGANIZATIONS_PG query aligns with the PR objective of implementing Postgres migration support for the user portal.

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

🧹 Nitpick comments (1)
src/screens/UserPortal/Organizations/Organizations.spec.tsx (1)

543-577: Add loading state verification.

The search test is thorough but could be improved by verifying the loading state during search operations.

Add loading state verification after the search action:

 await userEvent.click(searchBtn);

+// Verify loading state
+expect(screen.getByText('Loading...')).toBeInTheDocument();
+
 // Wait for search results to update
 await wait();
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f282775 and 204a09f.

📒 Files selected for processing (2)
  • src/screens/UserPortal/Organizations/Organizations.spec.tsx (5 hunks)
  • src/screens/UserPortal/Organizations/Organizations.tsx (7 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Test Application
🔇 Additional comments (5)
src/screens/UserPortal/Organizations/Organizations.tsx (3)

7-7: LGTM!

The import statement for the new GraphQL query is correctly added.


230-231: LGTM!

The data mapping is correctly updated to handle the new query structure.


265-267: LGTM! Good improvements.

The changes improve the code in two ways:

  1. Using some instead of find is more efficient as it stops iteration once a match is found.
  2. Adding optional chaining for membershipRequests adds null safety.

Also applies to: 272-273

src/screens/UserPortal/Organizations/Organizations.spec.tsx (2)

321-479: LGTM! Comprehensive test coverage.

The mock data is well-structured and covers essential scenarios:

  1. Initial load with multiple organizations
  2. Search functionality with filters
  3. Empty search case

650-659: LGTM! Good test improvements.

The test is well-structured with:

  1. Proper async handling using waitFor
  2. Specific assertions for the number of join buttons

Copy link

codecov bot commented Feb 22, 2025

Codecov Report

Attention: Patch coverage is 30.00000% with 7 lines in your changes missing coverage. Please review.

Project coverage is 85.96%. Comparing base (3168b8b) to head (204a09f).

Files with missing lines Patch % Lines
...screens/UserPortal/Organizations/Organizations.tsx 30.00% 3 Missing and 4 partials ⚠️
Additional details and impacted files
@@                 Coverage Diff                  @@
##           develop-postgres    #3730      +/-   ##
====================================================
- Coverage             86.09%   85.96%   -0.13%     
====================================================
  Files                   371      371              
  Lines                  9138     9139       +1     
  Branches               1925     1925              
====================================================
- Hits                   7867     7856      -11     
- Misses                  906      918      +12     
  Partials                365      365              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gkbishnoi07
Copy link
Author

@coderabbitai full review

Copy link
Contributor

coderabbitai bot commented Feb 22, 2025

No description provided.

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

🧹 Nitpick comments (3)
src/screens/UserPortal/Organizations/Organizations.tsx (2)

128-128: Remove unused state or use it.

You're only using setFilterName without reading its current state. If that's intentional, consider renaming the variable to _filterName or removing it altogether for clarity.

- const [, setFilterName] = React.useState('');
+ const [filterName, setFilterName] = React.useState('');

143-144: Initialize filter in the query variables.

Since the handleSearch function refetches with a filter argument, consider adding a default filter: '' to the initial query variables for consistency.

-  variables: { id: userId, first: rowsPerPage },
+  variables: { id: userId, first: rowsPerPage, filter: '' },
src/screens/UserPortal/Organizations/Organizations.spec.tsx (1)

543-577: Consider more granular checks in your search test.

The search test verifies the presence of organizations after typing “2” and clearing the input, but it doesn’t confirm which organizations disappear or reappear. You may want to add assertions ensuring “anyOrganization1” is absent after searching.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3168b8b and 204a09f.

📒 Files selected for processing (2)
  • src/screens/UserPortal/Organizations/Organizations.spec.tsx (5 hunks)
  • src/screens/UserPortal/Organizations/Organizations.tsx (7 hunks)
🧰 Additional context used
🪛 GitHub Check: codecov/patch
src/screens/UserPortal/Organizations/Organizations.tsx

[warning] 259-259: src/screens/UserPortal/Organizations/Organizations.tsx#L259
Added line #L259 was not covered by tests


[warning] 261-261: src/screens/UserPortal/Organizations/Organizations.tsx#L261
Added line #L261 was not covered by tests

🔇 Additional comments (4)
src/screens/UserPortal/Organizations/Organizations.tsx (2)

7-7: Looks good!

Importing the new USER_JOINED_ORGANIZATIONS_PG query seems correct.


229-251: Possible duplication in data handling logic.

Lines 229-251 form one approach to building the organizations array, while lines 259-285 contain a separate approach for mode === 0. Verify if both are needed or if any references to UserJoinedOrganizations vs. user.organizationsWhereMember are unintentional.

src/screens/UserPortal/Organizations/Organizations.spec.tsx (2)

321-419: Good addition of mocks for the new query.

The newly introduced mocks effectively cover the USER_JOINED_ORGANIZATIONS_PG scenarios, including the default and filtered responses.


637-660: Test approach looks solid.

Confirming that two "Join Now" buttons appear for two organizations is straightforward and clear. This effectively validates your UI for multiple organizations.

coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 22, 2025
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: 0

🧹 Nitpick comments (1)
src/screens/UserPortal/Organizations/Organizations.spec.tsx (1)

588-635: Enhance search test robustness.

While the search test covers basic functionality, it could be more robust:

  • Missing negative test cases (e.g., no results found)
  • No validation of loading states during search
  • No error handling test cases

Consider adding these test cases:

 test('Search works properly', async () => {
+  // Test no results found
+  await userEvent.type(searchInput, 'nonexistent');
+  await userEvent.click(searchBtn);
+  await wait();
+  expect(screen.getByText('No results found')).toBeInTheDocument();
+
+  // Test loading state
+  const searchPromise = userEvent.type(searchInput, '2');
+  expect(screen.getByTestId('loading-indicator')).toBeInTheDocument();
+  await searchPromise;
+
+  // Test error handling
+  // Add error mock and verify error message
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 204a09f and 0f683d5.

📒 Files selected for processing (1)
  • src/screens/UserPortal/Organizations/Organizations.spec.tsx (6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Test Application
🔇 Additional comments (3)
src/screens/UserPortal/Organizations/Organizations.spec.tsx (3)

9-9: LGTM! Comprehensive mock data for the new query.

The mock data for USER_JOINED_ORGANIZATIONS_PG is well-structured and covers multiple scenarios:

  • Default query with pagination
  • Search functionality
  • Empty search case

Also applies to: 321-479


695-718: LGTM! Improved join button test.

The test now properly verifies the number of join buttons based on the organizations loaded.


825-904: LGTM! Comprehensive edge case coverage.

Excellent addition of tests for:

  • Handling organizations with edges data structure
  • Empty edges case
  • Membership status verification

coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 22, 2025
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: 2

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0f683d5 and a3e16c5.

📒 Files selected for processing (1)
  • src/screens/UserPortal/Organizations/Organizations.spec.tsx (7 hunks)
🧰 Additional context used
🪛 ESLint
src/screens/UserPortal/Organizations/Organizations.spec.tsx

[error] 22-22: 'mocks' is defined but never used.

(@typescript-eslint/no-unused-vars)

🪛 GitHub Check: Performs linting, formatting, type-checking, checking for different source and target branch
src/screens/UserPortal/Organizations/Organizations.spec.tsx

[failure] 22-22:
'mocks' is defined but never used

🪛 GitHub Actions: PR Workflow
src/screens/UserPortal/Organizations/Organizations.spec.tsx

[error] 22-22: 'mocks' is defined but never used @typescript-eslint/no-unused-vars

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (4)
src/screens/UserPortal/Organizations/Organizations.spec.tsx (4)

322-480: LGTM! Well-structured mock data for different scenarios.

The mock data for USER_JOINED_ORGANIZATIONS_PG is comprehensive and covers multiple scenarios:

  • Default query with pagination
  • Search functionality with filter
  • Empty search case

588-635: LGTM! Thorough testing of search functionality.

The search test is well-implemented with clear steps:

  1. Initial state verification
  2. Search execution
  3. Clear search
  4. Re-search with keyboard event

695-718: LGTM! Improved test assertion for Join Now buttons.

The test now properly verifies the exact number of join buttons based on the number of organizations.


846-940: LGTM! Comprehensive test suite for edge/node data structure.

The new test suite thoroughly validates:

  • Loading state
  • Mode change interaction
  • Data structure processing
  • UI updates

coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 23, 2025
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

🧹 Nitpick comments (1)
src/screens/UserPortal/Organizations/Organizations.spec.tsx (1)

915-920: Consider reducing the waitFor timeout.

A timeout of 2000ms is quite long for unit tests. Consider reducing it to improve test execution time.

-      { timeout: 2000 },
+      { timeout: 1000 },

Also applies to: 927-932

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a3e16c5 and 6bf8a09.

📒 Files selected for processing (1)
  • src/screens/UserPortal/Organizations/Organizations.spec.tsx (6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyse Code With CodeQL (javascript)
🔇 Additional comments (4)
src/screens/UserPortal/Organizations/Organizations.spec.tsx (4)

321-479: LGTM! Well-structured mock data.

The mock data is comprehensive and covers all necessary test scenarios including pagination, filtering, and empty search cases.


595-629: LGTM! Comprehensive search functionality test.

The test covers all essential scenarios:

  • Initial state verification
  • Search input and button interaction
  • Keyboard events
  • Search clearing

702-711: LGTM! Improved join button verification.

The test now correctly waits for the organizations to load and verifies the exact number of join buttons, making it more reliable.


837-837: Remove duplicate link declaration.

The link constant is already declared at line 544.

coderabbitai[bot]
coderabbitai bot previously approved these changes Feb 23, 2025
@iamanishx
Copy link

@gkbishnoi07 can you please confirm why you introduced this one ??
what was the need of this ??
there is already a organizationCard.tsx in src/Userportal !!!!!!!!!!!!!!!!!!!

@gkbishnoi07
Copy link
Author

which one i introduce?? the organizationCard.tsx is in both src/Components/Userportal and src/Components

@iamanishx
Copy link

iamanishx commented Mar 20, 2025

which one i introduce?? the organizationCard.tsx is in both src/Components/Userportal and src/Components

The one you introduced
What was the need ?
You introduced the src/components one

@gkbishnoi07
Copy link
Author

which one i introduce?? the organizationCard.tsx is in both src/Components/Userportal and src/Components

The one you introduced What was the need ? You introduced the src/components one

where i inroduce? in which PR

@iamanishx
Copy link

which one i introduce?? the organizationCard.tsx is in both src/Components/Userportal and src/Components

The one you introduced What was the need ? You introduced the src/components one

where i inroduce? in which PR

https://github.com/PalisadoesFoundation/talawa-admin/pull/3278/files

this one

@iamanishx
Copy link

@gkbishnoi07 i wanted to know if ita has some speacial functionality other than the userPortal one ?

@gkbishnoi07
Copy link
Author

@gkbishnoi07 i wanted to know if ita has some speacial functionality other than the userPortal one ?

I updated this component to match the develop branch, but it's not currently in use anywhere. Right now, src/components/userportal is working since it's imported in organization.tsx. If I find a use for this component in the future, I'll update you. Hope that makes sense!

so right now focus on src/components/userportal
image

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.

3 participants