-
-
Notifications
You must be signed in to change notification settings - Fork 876
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
Upgraded package @testing-library/user-event to latest (Fixes #2072) #3569
Upgraded package @testing-library/user-event to latest (Fixes #2072) #3569
Conversation
WalkthroughThis pull request upgrades several testing dependencies and refines asynchronous handling across the codebase. In package.json, the versions of @testing-library/react and @testing-library/user-event are updated while an override for whatwg-url is added. Numerous test files have been modified to use async/await for userEvent interactions and to replace certain event methods for more reliable test execution. Additionally, a minor cleanup is performed in a script, a blob creation method in a component is improved, and tsconfig.json’s target is updated from es5 to ES2015. Changes
Sequence Diagram(s)Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested labels
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms (1)
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
Documentation and Community
|
Our Pull Request Approval ProcessThanks for contributing! Testing Your CodeRemember, your PRs won't be reviewed until these criteria are met:
Our policies make our code better. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
CONTRIBUTING.mdRead our CONTRIBUTING.md file. Most importantly:
Other
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 11
🔭 Outside diff range comments (6)
src/components/CheckIn/TableRow.tsx (1)
75-84
: Remove coverage exclusions and add proper tests.The code uses multiple
istanbul ignore
statements to exclude lines from coverage. Instead of ignoring coverage:
- Add tests for PDF generation
- Mock window.open and URL.createObjectURL
- Verify blob creation and URL handling
Example test structure:
it('should generate and open PDF', async () => { const mockCreateObjectURL = vi.fn(); const mockOpen = vi.fn(); global.URL.createObjectURL = mockCreateObjectURL; global.window.open = mockOpen; await generateTag(); expect(mockCreateObjectURL).toHaveBeenCalled(); expect(mockOpen).toHaveBeenCalled(); });src/components/RequestsTableItem/RequestsTableItem.spec.tsx (1)
91-104
: Add assertions after click event.The test lacks assertions after clicking the remove admin button. Consider adding expectations to verify the intended behavior:
-it('should render props and text elements test for the page component', async () => { +it('should handle remove admin button click', async () => { const props = { toggleRemoveModal: () => true, id: '456', }; renderOrgAdminListCard(props); await wait(); await userEvent.click(screen.getByTestId(/removeAdminBtn/i)); await wait(2000); + + // Add assertions to verify the expected behavior + await waitFor(() => { + // Verify that the modal was toggled + expect(props.toggleRemoveModal).toHaveBeenCalled(); + }); });src/components/OrgAdminListCard/OrgAdminListCard.spec.tsx (1)
32-38
: Replace custom wait function with waitFor.Instead of using a custom wait function, consider using the built-in
waitFor
from @testing-library/react:-async function wait(ms = 100): Promise<void> { - await act(() => { - return new Promise((resolve) => { - setTimeout(resolve, ms); - }); - }); -} it('should render props and text elements test for the page component', async () => { const props = { toggleRemoveModal: () => true, id: '456', }; renderOrgAdminListCard(props); - await wait(); + await waitFor(() => { + expect(screen.getByTestId(/removeAdminBtn/i)).toBeInTheDocument(); + }); await userEvent.click(screen.getByTestId(/removeAdminBtn/i)); - await wait(2000); + // Add assertions to verify the expected behavior after click + await waitFor(() => { + expect(props.toggleRemoveModal).toHaveBeenCalled(); + }); });Also applies to: 91-104
src/screens/OrgPost/OrgPost.spec.tsx (1)
333-333
: Remove redundant await keywords.There are instances of double await that should be fixed:
-await await userEvent.type(...) +await userEvent.type(...)Also applies to: 343-343, 663-665, 705-707, 710-711, 714-715, 767-769, 821-821, 827-828, 830-831, 851-851, 858-859, 861-862, 904-904, 936-939, 968-973, 998-999, 1004-1007, 1045-1050, 1128-1129
tsconfig.json (1)
1-24
: Unauthorized file change detected.According to the pipeline failures, this file is not authorized to be modified. Please remove the changes to this file and submit them in a separate PR after getting the necessary approvals.
🧰 Tools
🪛 GitHub Actions: PR Workflow
[error] 1-1: File is unauthorized to change/delete.
package.json (1)
1-194
: Unauthorized file change detected.According to the pipeline failures, this file is not authorized to be modified. Please remove the changes to this file and submit them in a separate PR after getting the necessary approvals.
🧰 Tools
🪛 GitHub Actions: PR Workflow
[error] 1-1: File is unauthorized to change/delete.
🧹 Nitpick comments (17)
src/components/UserPortal/StartPostModal/StartPostModal.spec.tsx (1)
133-133
: LGTM! Properly handling async user interactions.The addition of
await
to alluserEvent
interactions is correct and necessary. This change aligns with the upgrade to @testing-library/user-event v14+, where all user interactions became asynchronous by default to better simulate real user behavior.For future reference, when using @testing-library/user-event v14+:
- All user interactions (click, type, etc.) return promises and must be awaited
- This change improves test reliability by ensuring proper sequencing of events
Also applies to: 144-144, 147-147, 186-186, 189-189, 230-231, 261-262
src/components/EditCustomFieldDropDown/EditCustomFieldDropDown.spec.tsx (1)
59-61
: Consider using userEvent consistently instead of fireEvent.While both work, userEvent is preferred as it more accurately simulates real user behavior. Consider maintaining consistency with userEvent:
- fireEvent.click(getByTestId(`dropdown-btn-${index}`)); + await userEvent.click(getByTestId(`dropdown-btn-${index}`));src/components/Pagination/Pagination.spec.tsx (1)
38-38
: LGTM! Proper async handling of userEvent with act.The addition of
await
beforeuserEvent.click
calls withinact
is correct and necessary for the latest version of @testing-library/user-event.Consider removing the redundant
act
wrapper sinceuserEvent
methods are already wrapped inact
internally in newer versions:- await act(async () => { - await userEvent.click(screen.getByTestId('nextPage')); - }); + await userEvent.click(screen.getByTestId('nextPage'));Also applies to: 43-43, 48-48, 53-53, 95-95
src/screens/UserPortal/Volunteer/VolunteerManagement.spec.tsx (2)
113-133
: Improve test reliability with waitFor assertions.While the async handling is correct, consider wrapping the tab assertions in
waitFor
to make the tests more reliable against timing issues:test('Testing volunteer management tab switching', async () => { renderVolunteerManagement(); const invitationsBtn = screen.getByTestId('invitationsBtn'); await userEvent.click(invitationsBtn); - const invitationsTab = screen.getByTestId('invitationsTab'); - expect(invitationsTab).toBeInTheDocument(); + await waitFor(() => { + expect(screen.getByTestId('invitationsTab')).toBeInTheDocument(); + }); const actionsBtn = screen.getByTestId('actionsBtn'); await userEvent.click(actionsBtn); - const actionsTab = screen.getByTestId('actionsTab'); - expect(actionsTab).toBeInTheDocument(); + await waitFor(() => { + expect(screen.getByTestId('actionsTab')).toBeInTheDocument(); + }); const groupsBtn = screen.getByTestId('groupsBtn'); await userEvent.click(groupsBtn); - const groupsTab = screen.getByTestId('groupsTab'); - expect(groupsTab).toBeInTheDocument(); + await waitFor(() => { + expect(screen.getByTestId('groupsTab')).toBeInTheDocument(); + }); });
102-102
: Improve test descriptions for better clarity.Consider making the test descriptions more descriptive of the behavior being tested:
-test('Testing back button navigation', async () => { +test('should navigate to organization home when back button is clicked', async () => { -test('Testing volunteer management tab switching', async () => { +test('should display correct tab content when switching between tabs', async () => { -test('Component should highlight the selected tab', async () => { +test('should apply success class to selected tab button and remove from others', async () => { -test('should update the component state on tab switch', async () => { +test('should display actions tab content when actions button is clicked', async () => {Also applies to: 113-113, 134-134, 146-146
src/components/OrgAdminListCard/OrgAdminListCard.spec.tsx (1)
91-91
: Improve test descriptions for better clarity.Consider making the test descriptions more descriptive of the behavior being tested:
-it('should render props and text elements test for the page component', async () => { +it('should call toggleRemoveModal when remove admin button is clicked', async () => { -it('Should not render text elements when props value is not passed', async () => { +it('should navigate to org list screen when id prop is undefined', async () => { -it('should not call toast or reload if no data is returned from mutation', async () => { +it('should not show success message or reload page when mutation returns no data', async () => { -it('should call errorHandler when mutation fails', async () => { +it('should handle error with errorHandler when remove admin mutation fails', async () => {Also applies to: 106-106, 120-120, 164-164
src/screens/EventManagement/EventManagement.spec.tsx (1)
85-86
: Standardize click event handling across tests.The file uses a mix of
await userEvent.click()
andawait act(() => fireEvent.click())
for handling click events. For consistency with the @testing-library/user-event upgrade, prefer usingawait userEvent.click()
throughout.Apply this pattern to standardize the click event handling:
-await act(() => fireEvent.click(backButton)); +await userEvent.click(backButton);Also applies to: 98-99, 113-114, 158-159, 204-205, 227-229
src/components/EventRegistrantsModal/AddOnSpotAttendee.spec.tsx (1)
134-138
: Use userEvent.selectOptions for select elements.While the
await
has been correctly added touserEvent.type
calls, consider usinguserEvent.selectOptions
instead offireEvent.change
for select elements, as it better simulates real user interactions.Replace select element handling with:
-const genderSelect = screen.getByLabelText('Gender'); -fireEvent.change(genderSelect, { target: { value: 'Male' } }); +await userEvent.selectOptions(screen.getByLabelText('Gender'), 'Male');Also applies to: 165-169, 186-190, 239-240
src/components/UserPortal/UserNavbar/UserNavbar.spec.tsx (1)
32-38
: Consider removing custom wait function.With the latest version of @testing-library/user-event, the custom
wait
function between actions might be unnecessary as the package handles timing automatically through theawait
mechanism.Consider removing the custom wait function and unnecessary waits:
-await wait(); -await userEvent.click(screen.getByTestId('languageIcon')); -await wait(); +await userEvent.click(screen.getByTestId('languageIcon'));Also applies to: 87-93, 111-117, 135-141, 159-165, 183-189, 207-212
src/components/OrgSettings/General/OrgProfileFieldSettings/OrgProfileFieldSettings.spec.tsx (1)
234-246
: Standardize query methods across tests.The file mixes
screen
queries and destructuredgetByTestId/getByText
from render. For consistency and better practices, prefer usingscreen
queries throughout.Standardize the query methods:
-const { getByTestId, getByText } = render( +render( <MockedProvider mocks={MOCKS} addTypename={false} link={link}> <I18nextProvider i18n={i18nForTest}> <OrgProfileFieldSettings /> </I18nextProvider> </MockedProvider>, ); -const fieldNameInput = getByTestId('customFieldInput'); +const fieldNameInput = screen.getByTestId('customFieldInput');Also applies to: 248-258
src/screens/Requests/Requests.spec.tsx (1)
214-217
: Consider removing unnecessaryact
wrapper.Since
userEvent
methods are already wrapped inact
internally in the newer versions, this explicitact
wrapper is unnecessary and can be simplified.- await act( - async () => - await userEvent.type(screen.getByTestId(/searchByName/i), search), - ); + await userEvent.type(screen.getByTestId(/searchByName/i), search);src/screens/OrganizationFundCampaign/OrganizationFundCampaign.spec.tsx (1)
183-186
: Consider usinguserEvent
consistently instead offireEvent
.For better consistency and to simulate real user interactions more accurately, consider replacing
fireEvent
withuserEvent
in the following cases:- fireEvent.change(searchField, { - target: { value: '2' }, - }); - fireEvent.click(screen.getByTestId('searchBtn')); + await userEvent.type(searchField, '2'); + await userEvent.click(screen.getByTestId('searchBtn')); - fireEvent.click(sortBtn); - fireEvent.click(screen.getByTestId('endDate_DESC')); + await userEvent.click(sortBtn); + await userEvent.click(screen.getByTestId('endDate_DESC')); - fireEvent.click(sortBtn); - fireEvent.click(screen.getByTestId('endDate_ASC')); + await userEvent.click(sortBtn); + await userEvent.click(screen.getByTestId('endDate_ASC')); - fireEvent.click(sortBtn); - fireEvent.click(screen.getByTestId('fundingGoal_ASC')); + await userEvent.click(sortBtn); + await userEvent.click(screen.getByTestId('fundingGoal_ASC')); - fireEvent.click(sortBtn); - fireEvent.click(screen.getByTestId('fundingGoal_DESC')); + await userEvent.click(sortBtn); + await userEvent.click(screen.getByTestId('fundingGoal_DESC')); - fireEvent.click(campaignName[0]); + await userEvent.click(campaignName[0]); - fireEvent.click(viewBtn[0]); + await userEvent.click(viewBtn[0]); - fireEvent.click(fundBreadcrumb); + await userEvent.click(fundBreadcrumb);The
userEvent
library provides a more complete simulation of real user events and is the recommended approach for testing user interactions.Also applies to: 219-220, 241-242, 263-264, 283-284, 302-303
src/components/OrgSettings/General/OrgUpdate/OrgUpdate.spec.tsx (1)
142-149
: Consider usinguserEvent
consistently instead offireEvent
.For better consistency and to simulate real user interactions more accurately, consider replacing
fireEvent.change
withuserEvent.clear
followed byuserEvent.type
when clearing form fields:- fireEvent.change(name, { target: { value: '' } }); - fireEvent.change(des, { target: { value: '' } }); - fireEvent.change(city, { target: { value: '' } }); - fireEvent.change(line1, { target: { value: '' } }); - fireEvent.change(line2, { target: { value: '' } }); - fireEvent.change(postalCode, { target: { value: '' } }); - fireEvent.change(sortingCode, { target: { value: '' } }); - fireEvent.change(dependentLocality, { target: { value: '' } }); + await userEvent.clear(name); + await userEvent.clear(des); + await userEvent.clear(city); + await userEvent.clear(line1); + await userEvent.clear(line2); + await userEvent.clear(postalCode); + await userEvent.clear(sortingCode); + await userEvent.clear(dependentLocality);The
userEvent
library provides a more complete simulation of real user events and is the recommended approach for testing user interactions.Also applies to: 228-235
src/screens/UserPortal/Pledges/Pledge.spec.tsx (1)
1-365
: Well-structured upgrade of @testing-library/user-event usage.The changes consistently implement the asynchronous pattern required by newer versions of @testing-library/user-event. This is a crucial architectural improvement that:
- Ensures reliable test execution by properly handling async user interactions
- Prevents potential race conditions in tests
- Aligns with the library's current best practices
For future test development:
- Always use
await
with userEvent methods- Combine with
waitFor
for assertions that depend on state updates- Consider using
setup()
from userEvent for test setup (new feature in v14)src/screens/MemberDetail/MemberDetail.spec.tsx (1)
199-201
: Remove or implement the commented out test code.These commented out lines should either be implemented or removed to maintain code cleanliness.
src/components/AddPeopleToTag/AddPeopleToTag.spec.tsx (1)
1-470
: Overall changes look good and align with package upgrade requirements.The modifications across all files consistently implement the required changes for upgrading @testing-library/user-event:
- All userEvent interactions are properly awaited
- Test reliability is improved by ensuring async operations complete
- Changes follow best practices for testing async interactions
The only minor issue is some commented out test code that should be addressed.
src/components/Advertisements/Advertisements.spec.tsx (1)
393-394
: LGTM! Proper handling of asynchronous user events.The changes correctly await the userEvent actions, which is required by the newer version of @testing-library/user-event.
Consider using
userEvent.selectOptions
instead offireEvent.change
for select inputs as it better simulates real user interactions:- fireEvent.change(screen.getByLabelText('Select type of Advertisement'), { - target: { value: 'POPUP' }, - }); + await userEvent.selectOptions(screen.getByLabelText('Select type of Advertisement'), 'POPUP');Also applies to: 410-422
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (97)
package.json
(2 hunks)scripts/githooks/update-toc.js
(0 hunks)src/components/AddOn/core/AddOnRegister/AddOnRegister.spec.tsx
(3 hunks)src/components/AddOn/core/AddOnStore/AddOnStore.spec.tsx
(2 hunks)src/components/AddPeopleToTag/AddPeopleToTag.spec.tsx
(5 hunks)src/components/Advertisements/Advertisements.spec.tsx
(3 hunks)src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.spec.tsx
(2 hunks)src/components/AgendaCategory/AgendaCategoryContainer.spec.tsx
(10 hunks)src/components/AgendaItems/AgendaItemsContainer.spec.tsx
(11 hunks)src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx
(2 hunks)src/components/CheckIn/TableRow.tsx
(1 hunks)src/components/DynamicDropDown/DynamicDropDown.spec.tsx
(3 hunks)src/components/EditCustomFieldDropDown/EditCustomFieldDropDown.spec.tsx
(2 hunks)src/components/EventListCard/EventListCard.spec.tsx
(38 hunks)src/components/EventManagement/EventAgendaItems/EventAgendaItems.spec.tsx
(3 hunks)src/components/EventManagement/EventAttendance/EventAttendance.spec.tsx
(3 hunks)src/components/EventManagement/EventAttendance/EventStatistics.spec.tsx
(6 hunks)src/components/EventRegistrantsModal/AddOnSpotAttendee.spec.tsx
(4 hunks)src/components/LeftDrawer/LeftDrawer.spec.tsx
(2 hunks)src/components/LeftDrawerOrg/LeftDrawerOrg.spec.tsx
(2 hunks)src/components/MemberRequestCard/MemberRequestCard.spec.tsx
(6 hunks)src/components/OrgAdminListCard/OrgAdminListCard.spec.tsx
(3 hunks)src/components/OrgListCard/OrgListCard.spec.tsx
(2 hunks)src/components/OrgPeopleListCard/OrgPeopleListCard.spec.tsx
(4 hunks)src/components/OrgPostCard/OrgPostCard.spec.tsx
(28 hunks)src/components/OrgSettings/ActionItemCategories/CategoryModal.spec.tsx
(3 hunks)src/components/OrgSettings/ActionItemCategories/OrgActionItemCategories.spec.tsx
(5 hunks)src/components/OrgSettings/AgendaItemCategories/AgendaCategoryUpdateModal.spec.tsx
(2 hunks)src/components/OrgSettings/AgendaItemCategories/OrganizationAgendaCategory.spec.tsx
(7 hunks)src/components/OrgSettings/General/OrgProfileFieldSettings/OrgProfileFieldSettings.spec.tsx
(5 hunks)src/components/OrgSettings/General/OrgUpdate/OrgUpdate.spec.tsx
(2 hunks)src/components/Pagination/Pagination.spec.tsx
(2 hunks)src/components/ProfileCard/ProfileCard.spec.tsx
(4 hunks)src/components/ProfileDropdown/ProfileDropdown.spec.tsx
(5 hunks)src/components/RecurrenceOptions/CustomRecurrence.spec.tsx
(20 hunks)src/components/RecurrenceOptions/RecurrenceOptions.spec.tsx
(13 hunks)src/components/RequestsTableItem/RequestsTableItem.spec.tsx
(4 hunks)src/components/TagActions/TagActions.spec.tsx
(9 hunks)src/components/UpdateSession/UpdateSession.spec.tsx
(7 hunks)src/components/UserListCard/UserListCard.spec.tsx
(2 hunks)src/components/UserPasswordUpdate/UserPasswordUpdate.spec.tsx
(7 hunks)src/components/UserPortal/CommentCard/CommentCard.spec.tsx
(10 hunks)src/components/UserPortal/ContactCard/ContactCard.spec.tsx
(2 hunks)src/components/UserPortal/EventCard/EventCard.spec.tsx
(2 hunks)src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.spec.tsx
(8 hunks)src/components/UserPortal/PostCard/PostCard.spec.tsx
(11 hunks)src/components/UserPortal/Register/Register.spec.tsx
(8 hunks)src/components/UserPortal/StartPostModal/StartPostModal.spec.tsx
(5 hunks)src/components/UserPortal/UserNavbar/UserNavbar.spec.tsx
(8 hunks)src/components/UserPortal/UserSidebarOrg/UserSidebarOrg.spec.tsx
(2 hunks)src/components/UsersTableItem/UserTableItem.spec.tsx
(1 hunks)src/components/Venues/VenueModal.spec.tsx
(16 hunks)src/screens/BlockUser/BlockUser.spec.tsx
(6 hunks)src/screens/CommunityProfile/CommunityProfile.spec.tsx
(8 hunks)src/screens/EventManagement/EventManagement.spec.tsx
(8 hunks)src/screens/EventVolunteers/Requests/Requests.spec.tsx
(4 hunks)src/screens/EventVolunteers/VolunteerContainer.spec.tsx
(4 hunks)src/screens/EventVolunteers/VolunteerGroups/VolunteerGroupDeleteModal.spec.tsx
(3 hunks)src/screens/EventVolunteers/VolunteerGroups/VolunteerGroupModal.spec.tsx
(6 hunks)src/screens/EventVolunteers/VolunteerGroups/VolunteerGroups.spec.tsx
(3 hunks)src/screens/EventVolunteers/Volunteers/VolunteerCreateModal.spec.tsx
(2 hunks)src/screens/EventVolunteers/Volunteers/VolunteerDeleteModal.spec.tsx
(3 hunks)src/screens/EventVolunteers/Volunteers/Volunteers.spec.tsx
(4 hunks)src/screens/ForgotPassword/ForgotPassword.spec.tsx
(8 hunks)src/screens/FundCampaignPledge/FundCampaignPledge.spec.tsx
(6 hunks)src/screens/Leaderboard/Leaderboard.spec.tsx
(2 hunks)src/screens/LoginPage/LoginPage.spec.tsx
(22 hunks)src/screens/ManageTag/ManageTag.spec.tsx
(15 hunks)src/screens/MemberDetail/MemberDetail.spec.tsx
(6 hunks)src/screens/OrgList/OrgList.spec.tsx
(10 hunks)src/screens/OrgList/OrganizationModal.spec.tsx
(7 hunks)src/screens/OrgPost/OrgPost.spec.tsx
(19 hunks)src/screens/OrgSettings/OrgSettings.spec.tsx
(3 hunks)src/screens/OrganizationActionItems/OrganizationActionItems.spec.tsx
(7 hunks)src/screens/OrganizationEvents/OrganizationEvents.spec.tsx
(10 hunks)src/screens/OrganizationFundCampaign/OrganizationFundCampaign.spec.tsx
(2 hunks)src/screens/OrganizationFunds/OrganizationFunds.spec.tsx
(2 hunks)src/screens/OrganizationPeople/OrganizationPeople.spec.tsx
(31 hunks)src/screens/OrganizationTags/OrganizationTags.spec.tsx
(8 hunks)src/screens/Requests/Requests.spec.tsx
(2 hunks)src/screens/SubTags/SubTags.spec.tsx
(9 hunks)src/screens/UserPortal/Campaigns/Campaigns.spec.tsx
(6 hunks)src/screens/UserPortal/Donate/Donate.spec.tsx
(15 hunks)src/screens/UserPortal/Events/Events.spec.tsx
(7 hunks)src/screens/UserPortal/Organizations/Organizations.spec.tsx
(5 hunks)src/screens/UserPortal/People/People.spec.tsx
(12 hunks)src/screens/UserPortal/Pledges/Pledge.spec.tsx
(9 hunks)src/screens/UserPortal/Posts/Posts.spec.tsx
(6 hunks)src/screens/UserPortal/Settings/Settings.spec.tsx
(2 hunks)src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx
(3 hunks)src/screens/UserPortal/Volunteer/Groups/GroupModal.spec.tsx
(11 hunks)src/screens/UserPortal/Volunteer/Groups/Groups.spec.tsx
(4 hunks)src/screens/UserPortal/Volunteer/Invitations/Invitations.spec.tsx
(4 hunks)src/screens/UserPortal/Volunteer/UpcomingEvents/UpcomingEvents.spec.tsx
(5 hunks)src/screens/UserPortal/Volunteer/VolunteerManagement.spec.tsx
(4 hunks)src/screens/Users/Users.spec.tsx
(5 hunks)tsconfig.json
(1 hunks)
💤 Files with no reviewable changes (1)
- scripts/githooks/update-toc.js
🧰 Additional context used
📓 Learnings (5)
src/components/TagActions/TagActions.spec.tsx (1)
Learnt from: meetulr
PR: PalisadoesFoundation/talawa-admin#2362
File: src/components/TagActions/TagActions.test.tsx:30-36
Timestamp: 2024-11-12T10:40:58.655Z
Learning: In our unit tests (e.g., `TagActions.test.tsx`), we use `setTimeout` with `act` to wait for asynchronous operations, as it provides a consistent wait time and is our standard practice.
src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.spec.tsx (1)
Learnt from: IITI-tushar
PR: PalisadoesFoundation/talawa-admin#2680
File: src/components/Advertisements/core/AdvertisementEntry/AdvertisementEntry.spec.tsx:528-712
Timestamp: 2024-12-22T07:43:26.168Z
Learning: You prefer to keep migrated tests even if they appear duplicated because they originated from the old AdvertisementEntry.test.tsx file.
src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx (2)
Learnt from: bitbard3
PR: PalisadoesFoundation/talawa-admin#2588
File: src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx:145-155
Timestamp: 2024-12-02T04:20:11.745Z
Learning: In PRs focused solely on refactoring test cases from Jest to Vitest, avoid suggesting optimizations or changes outside the migration scope.
Learnt from: bitbard3
PR: PalisadoesFoundation/talawa-admin#2588
File: src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx:155-162
Timestamp: 2024-12-03T05:52:37.888Z
Learning: In the `ChangeLanguageDropdown` component (`src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.tsx`), error handling has not been implemented. Therefore, test cases in `src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx` do not cover error scenarios related to error handling.
src/screens/OrganizationPeople/OrganizationPeople.spec.tsx (1)
Learnt from: meetulr
PR: PalisadoesFoundation/talawa-admin#2425
File: src/screens/MemberDetail/MemberDetail.test.tsx:100-100
Timestamp: 2024-11-12T10:40:58.654Z
Learning: In `src/screens/MemberDetail/MemberDetail.test.tsx`, using `await wait();` is acceptable to wait for the render to complete.
src/components/Advertisements/Advertisements.spec.tsx (1)
Learnt from: IITI-tushar
PR: PalisadoesFoundation/talawa-admin#2680
File: src/components/Advertisements/core/AdvertisementEntry/AdvertisementEntry.spec.tsx:528-712
Timestamp: 2024-12-22T07:43:26.168Z
Learning: You prefer to keep migrated tests even if they appear duplicated because they originated from the old AdvertisementEntry.test.tsx file.
🪛 GitHub Actions: PR Workflow
tsconfig.json
[error] 1-1: File is unauthorized to change/delete.
package.json
[error] 1-1: File is unauthorized to change/delete.
src/components/CheckIn/TableRow.tsx
[error] 1-1: File contains code coverage disable statement. Please remove it and add the appropriate tests.
🔇 Additional comments (84)
src/components/UserListCard/UserListCard.spec.tsx (1)
58-58
: LGTM! Proper async handling of user events.The changes correctly implement the async pattern required by the latest version of @testing-library/user-event.
Also applies to: 77-77
src/screens/EventVolunteers/VolunteerContainer.spec.tsx (1)
79-94
: LGTM! Excellent implementation of the new userEvent patterns.The changes demonstrate best practices with the latest @testing-library/user-event:
- Proper setup using userEvent.setup()
- Consistent async handling
- Clean assertions using findByTestId
src/components/CheckIn/TableRow.tsx (1)
76-78
: LGTM! Improved binary data handling.The change to use Uint8Array for the Blob creation is a good practice for handling binary data.
src/components/UserPortal/ContactCard/ContactCard.spec.tsx (1)
104-104
: LGTM! Proper async handling of userEvent.The addition of
await
beforeuserEvent.click
calls is correct and necessary for the latest version of @testing-library/user-event.Also applies to: 129-129
src/screens/EventVolunteers/Volunteers/VolunteerDeleteModal.spec.tsx (1)
102-102
: LGTM! Proper async handling of userEvent.The addition of
await
beforeuserEvent.click
calls is correct and necessary for the latest version of @testing-library/user-event.Also applies to: 117-117, 130-130
src/screens/EventVolunteers/Volunteers/VolunteerCreateModal.spec.tsx (1)
98-98
: LGTM! Correctly updated userEvent interactions.The changes properly implement the async nature of userEvent interactions required by the latest version.
Also applies to: 123-123
src/screens/EventVolunteers/VolunteerGroups/VolunteerGroupDeleteModal.spec.tsx (1)
114-114
: LGTM! Correctly updated userEvent interactions.The changes properly implement the async nature of userEvent interactions required by the latest version.
Also applies to: 129-129, 142-142
src/components/DynamicDropDown/DynamicDropDown.spec.tsx (1)
47-47
: LGTM! Correctly updated userEvent interactions.The changes properly implement the async nature of userEvent interactions required by the latest version, maintaining the act() wrapper for state updates.
Also applies to: 53-53, 88-88, 93-93, 130-130
src/components/ChangeLanguageDropdown/ChangeLanguageDropdown.spec.tsx (1)
75-75
: LGTM! Correctly updated userEvent interactions.The changes properly implement the async nature of userEvent interactions required by the latest version.
Also applies to: 140-140, 146-146, 150-150, 156-156
src/components/ProfileCard/ProfileCard.spec.tsx (1)
137-139
: LGTM!The async handling of user events is correctly implemented with proper use of
act
andawait
. The test structure is good with clear assertions.Also applies to: 158-160, 182-184, 206-208
src/components/OrgSettings/AgendaItemCategories/AgendaCategoryUpdateModal.spec.tsx (1)
68-92
: LGTM! Correctly updated userEvent interactions.The changes properly implement async/await pattern for userEvent interactions, which is required for the latest version of @testing-library/user-event.
src/screens/OrgSettings/OrgSettings.spec.tsx (1)
116-128
: LGTM! Correctly updated userEvent interactions.The changes properly implement async/await pattern for userEvent interactions in both active and commented-out test code.
Also applies to: 142-151
src/components/EventManagement/EventAgendaItems/EventAgendaItems.spec.tsx (1)
135-148
: LGTM! Correctly updated userEvent interactions and waitFor logic.The changes properly implement:
- async/await pattern for userEvent interactions (both click and type)
- Improved modal close verification using waitFor
Also applies to: 171-200
src/components/UserPortal/EventCard/EventCard.spec.tsx (2)
140-140
: LGTM! Correctly awaiting user interaction.The addition of
await
beforeuserEvent.click
is necessary for proper handling of asynchronous user interactions in the newer version of@testing-library/user-event
.
175-175
: LGTM! Correctly awaiting user interaction.The addition of
await
beforeuserEvent.click
ensures proper handling of asynchronous user interactions.src/components/AddOn/core/AddOnRegister/AddOnRegister.spec.tsx (3)
123-135
: LGTM! Correctly awaiting user interactions.The addition of
await
beforeuserEvent
methods ensures proper handling of asynchronous user interactions in the newer version of@testing-library/user-event
.
154-170
: LGTM! Correctly awaiting user interactions.The addition of
await
beforeuserEvent
methods ensures proper handling of asynchronous user interactions.
191-207
: LGTM! Correctly awaiting user interactions.The addition of
await
beforeuserEvent
methods ensures proper handling of asynchronous user interactions.src/components/EventManagement/EventAttendance/EventAttendance.spec.tsx (3)
107-110
: LGTM! Correctly awaiting user interactions.The addition of
await
beforeuserEvent.click
ensures proper handling of asynchronous user interactions in the newer version of@testing-library/user-event
.
125-128
: LGTM! Correctly awaiting user interactions.The addition of
await
beforeuserEvent.click
ensures proper handling of asynchronous user interactions.
142-143
: LGTM! Correctly awaiting user interactions.The addition of
await
beforeuserEvent.click
ensures proper handling of asynchronous user interactions.Also applies to: 149-149
src/components/ProfileDropdown/ProfileDropdown.spec.tsx (5)
134-135
: LGTM! Correctly awaiting user interactions.The addition of
await
beforeuserEvent.click
ensures proper handling of asynchronous user interactions in the newer version of@testing-library/user-event
.Also applies to: 137-137
157-158
: LGTM! Correctly awaiting user interactions.The addition of
await
beforeuserEvent.click
ensures proper handling of asynchronous user interactions.Also applies to: 161-162
182-183
: LGTM! Correctly awaiting user interactions.The addition of
await
beforeuserEvent.click
ensures proper handling of asynchronous user interactions.Also applies to: 186-187
210-211
: LGTM! Correctly awaiting user interactions.The addition of
await
beforeuserEvent.click
ensures proper handling of asynchronous user interactions.Also applies to: 214-215
238-239
: LGTM! Correctly awaiting user interactions.The addition of
await
beforeuserEvent.click
ensures proper handling of asynchronous user interactions.Also applies to: 242-243
src/components/LeftDrawer/LeftDrawer.spec.tsx (1)
100-100
: LGTM! All userEvent calls are properly awaited.The changes correctly add
await
to alluserEvent
method calls, which is required for the newer version of@testing-library/user-event
where all user events are asynchronous by default.Also applies to: 106-106, 203-203
src/components/OrgSettings/ActionItemCategories/CategoryModal.spec.tsx (1)
107-107
: LGTM! All userEvent calls are properly awaited.The changes correctly add
await
to alluserEvent
method calls, which is required for the newer version of@testing-library/user-event
where all user events are asynchronous by default.Also applies to: 109-109, 137-137, 214-214
src/screens/UserPortal/Volunteer/UpcomingEvents/UpcomingEvents.spec.tsx (1)
148-148
: LGTM! All userEvent calls are properly awaited.The changes correctly add
await
to alluserEvent
method calls, which is required for the newer version of@testing-library/user-event
where all user events are asynchronous by default.Also applies to: 152-152, 154-154, 168-168, 172-172, 175-175, 203-203, 215-215, 219-219, 230-230
src/components/UserPasswordUpdate/UserPasswordUpdate.spec.tsx (1)
52-63
: LGTM! All userEvent calls are properly awaited.The changes correctly add
await
to alluserEvent
method calls, which is required for the newer version of@testing-library/user-event
where all user events are asynchronous by default.Also applies to: 65-65, 85-85, 102-113, 115-115, 141-152, 154-154, 181-192, 194-194, 226-237, 239-239, 266-266
src/screens/OrganizationFunds/OrganizationFunds.spec.tsx (1)
126-126
: LGTM! Correctly addedawait
to userEvent interactions.The changes properly implement the required
await
for all userEvent interactions, which is necessary for the upgraded @testing-library/user-event package. This ensures that user interactions are properly awaited before proceeding with subsequent assertions.Also applies to: 131-131, 147-147, 154-154, 219-221, 229-229, 232-232, 240-240, 243-243, 251-251, 254-254
src/screens/EventVolunteers/VolunteerGroups/VolunteerGroups.spec.tsx (1)
157-157
: LGTM! Correctly addedawait
to userEvent interactions.The changes properly implement the required
await
for all userEvent interactions (both click and type events), which is necessary for the upgraded @testing-library/user-event package.Also applies to: 161-161, 163-163, 178-178, 182-182, 185-185, 207-207, 211-211, 213-213
src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx (1)
182-182
: LGTM! Correctly addedawait
to userEvent interactions.The changes properly implement the required
await
for all userEvent interactions, which is necessary for the upgraded @testing-library/user-event package.Also applies to: 186-186, 207-207, 211-211, 213-213, 244-244, 250-250, 257-257, 265-265, 291-291, 318-318
src/components/MemberRequestCard/MemberRequestCard.spec.tsx (1)
167-167
: LGTM! Correctly addedawait
to userEvent interactions.The changes properly implement the required
await
for all userEvent interactions, which is necessary for the upgraded @testing-library/user-event package.Also applies to: 168-168, 197-197, 198-198, 233-233, 265-265, 291-291, 318-318
src/screens/EventVolunteers/Requests/Requests.spec.tsx (1)
170-170
: LGTM! The changes improve test reliability.The addition of
await
touserEvent
interactions ensures proper handling of asynchronous operations, which is crucial for reliable testing. This change aligns with the upgrade to@testing-library/user-event
and follows best practices.Also applies to: 207-207, 224-224
src/screens/UserPortal/Volunteer/Groups/Groups.spec.tsx (1)
191-191
: LGTM! The changes improve test reliability.The addition of
await
touserEvent
interactions ensures proper handling of asynchronous operations, which is crucial for reliable testing. This change aligns with the upgrade to@testing-library/user-event
and follows best practices.Also applies to: 195-195, 197-197, 214-214, 218-218, 221-221, 258-258, 261-263, 273-273, 276-276
src/screens/Requests/Requests.spec.tsx (1)
177-177
: LGTM! The changes improve test reliability.The addition of
await
touserEvent
interactions ensures proper handling of asynchronous operations, which is crucial for reliable testing. This change aligns with the upgrade to@testing-library/user-event
and follows best practices.Also applies to: 178-178, 182-182, 183-183, 189-189, 190-190, 192-192, 193-193
src/components/OrgSettings/ActionItemCategories/OrgActionItemCategories.spec.tsx (1)
173-173
: LGTM! The changes improve test reliability.The addition of
await
touserEvent
interactions ensures proper handling of asynchronous operations, which is crucial for reliable testing. This change aligns with the upgrade to@testing-library/user-event
and follows best practices.Also applies to: 176-178, 191-191, 196-198, 212-212, 213-213, 227-227, 241-241
src/screens/EventVolunteers/Volunteers/Volunteers.spec.tsx (1)
224-224
: LGTM! Correctly addedawait
to userEvent calls.The changes properly handle the asynchronous nature of user events in the newer version of @testing-library/user-event. This is a required change as the package now returns promises for all user interactions.
Also applies to: 264-264, 267-267, 278-278, 281-281, 292-292, 295-295
src/screens/UserPortal/Volunteer/Invitations/Invitations.spec.tsx (1)
230-230
: LGTM! Correctly addedawait
to userEvent calls.The changes properly handle the asynchronous nature of user events in the newer version of @testing-library/user-event. This is a required change as the package now returns promises for all user interactions.
Also applies to: 269-269, 285-285, 301-301
src/screens/UserPortal/Volunteer/Groups/GroupModal.spec.tsx (1)
148-148
: LGTM! Correctly addedawait
to userEvent calls.The changes properly handle the asynchronous nature of user events in the newer version of @testing-library/user-event. This is a required change as the package now returns promises for all user interactions.
Also applies to: 157-157, 169-169, 178-178, 190-190, 194-194, 218-218, 248-248, 261-261, 270-270, 288-288, 289-289, 312-312
src/screens/Leaderboard/Leaderboard.spec.tsx (1)
257-257
: LGTM! Correctly addedawait
to userEvent calls.The changes properly handle the asynchronous nature of user events in the newer version of @testing-library/user-event. This is a required change as the package now returns promises for all user interactions.
Also applies to: 275-275
src/components/UserPortal/Register/Register.spec.tsx (1)
139-139
: LGTM! Well-structured test cases with proper async handling.The changes to add
await
touserEvent
interactions are correct and improve the reliability of the tests. The test cases are well-documented and cover important functionality.Also applies to: 159-159, 179-180, 200-205, 225-234, 254-267, 289-306, 331-340
src/screens/SubTags/SubTags.spec.tsx (1)
148-148
: LGTM! Properly awaited userEvent calls.The changes correctly add
await
before alluserEvent
method calls, which is necessary for the newer versions of @testing-library/user-event where all user interactions are asynchronous.Also applies to: 155-155, 172-172, 187-187, 202-202, 217-217, 232-232, 287-287, 292-292, 309-309, 356-356, 358-359, 363-363
src/components/OrgSettings/AgendaItemCategories/OrganizationAgendaCategory.spec.tsx (1)
148-148
: LGTM! Properly awaited userEvent calls.The changes correctly add
await
before alluserEvent
method calls, aligning with the asynchronous API of the newer @testing-library/user-event version.Also applies to: 155-156, 185-185, 193-194, 202-204, 233-233, 241-242, 246-247, 250-252
src/screens/EventVolunteers/VolunteerGroups/VolunteerGroupModal.spec.tsx (1)
199-199
: LGTM! Properly awaited userEvent calls.The changes correctly add
await
before alluserEvent
method calls, ensuring proper handling of asynchronous user interactions.Also applies to: 249-249, 277-277, 307-307, 326-327, 350-350
src/screens/UserPortal/Pledges/Pledge.spec.tsx (1)
153-153
: LGTM! Properly awaited userEvent calls.The changes correctly add
await
before alluserEvent
method calls, maintaining consistency with the asynchronous nature of the updated library.Also applies to: 157-157, 175-175, 179-179, 197-197, 201-201, 219-219, 223-223, 242-242, 247-247, 301-301, 312-312, 324-324, 329-329, 340-340, 345-345
src/screens/OrganizationTags/OrganizationTags.spec.tsx (1)
130-130
: LGTM! Proper handling of asynchronous user events.The addition of
await
beforeuserEvent
calls ensures reliable test execution by properly handling asynchronous operations. This change aligns with testing best practices and the upgraded@testing-library/user-event
package.Also applies to: 137-137, 139-142, 153-153, 167-167, 220-220, 225-225, 237-237, 242-242, 287-287, 289-289, 295-298, 300-300, 313-313, 315-318, 320-320
src/screens/ForgotPassword/ForgotPassword.spec.tsx (1)
181-184
: LGTM! Consistent handling of asynchronous user events.The addition of
await
beforeuserEvent
calls ensures proper test synchronization and aligns with the upgraded@testing-library/user-event
package's requirements.Also applies to: 186-186, 214-217, 219-219, 222-225, 226-229, 230-233, 261-264, 266-266, 269-269, 308-311, 313-316, 351-354, 398-401, 402-402
src/screens/UserPortal/Campaigns/Campaigns.spec.tsx (1)
220-220
: LGTM! Proper handling of asynchronous operations in user interaction tests.The addition of
await
beforeuserEvent
calls ensures reliable test execution and aligns with the upgraded@testing-library/user-event
package's requirements.Also applies to: 224-224, 246-246, 250-250, 272-272, 276-276, 298-298, 302-302, 340-340, 345-345, 356-356
src/components/TagActions/TagActions.spec.tsx (1)
170-170
: LGTM! Proper handling of asynchronous operations in user interaction tests.The addition of
await
beforeuserEvent
calls ensures reliable test execution and aligns with:
- The project's standard practice of handling asynchronous operations
- The upgraded
@testing-library/user-event
package's requirementsAlso applies to: 196-196, 261-261, 266-266, 271-271, 276-276, 288-288, 314-314, 319-319, 324-324, 330-330, 335-335, 341-341, 352-352, 365-365, 380-380, 385-385, 387-387, 405-405, 407-407
src/screens/FundCampaignPledge/FundCampaignPledge.spec.tsx (1)
138-138
: LGTM! Proper handling of asynchronous user events.The addition of
await
beforeuserEvent
calls is a necessary improvement that aligns with the latest version of @testing-library/user-event. This ensures that user interactions are properly awaited before proceeding with subsequent assertions.Also applies to: 143-143, 154-154, 159-159, 170-170, 175-175, 245-245, 258-258, 275-275, 282-282
src/components/UserPortal/UserSidebarOrg/UserSidebarOrg.spec.tsx (1)
330-330
: LGTM! Consistent handling of asynchronous user events.The addition of
await
beforeuserEvent
calls maintains consistency with the updated testing library and ensures reliable test execution.Also applies to: 352-352
src/screens/UserPortal/Posts/Posts.spec.tsx (1)
312-312
: LGTM! Improved handling of user interactions.The changes include:
- Adding
await
touserEvent
calls for proper async handling- Using
fireEvent
instead ofuserEvent
for file input operations, which is more appropriate for direct DOM manipulationAlso applies to: 321-324, 334-334, 343-343, 349-351
src/components/AgendaCategory/AgendaCategoryContainer.spec.tsx (1)
118-120
: LGTM! Enhanced test reliability.The changes improve the test suite by:
- Adding
await
touserEvent
calls for proper async handling- Replacing
waitForElementToBeRemoved
with explicitwaitFor
assertions, making the test intentions clearerAlso applies to: 127-129, 131-135, 158-160, 167-169, 171-175, 198-200, 213-213, 220-220, 222-226, 233-235, 242-244, 246-250, 275-277, 283-283, 286-286, 291-291, 322-324, 332-333, 338-338, 367-369, 382-382, 390-390, 419-421, 434-434, 441-441
src/components/AgendaItems/AgendaItemsContainer.spec.tsx (1)
119-126
: LGTM! The changes correctly implement async user interactions.The modifications properly await all userEvent interactions and improve the test reliability by:
- Adding
await
to all userEvent.click() and userEvent.type() calls- Replacing waitForElementToBeRemoved with waitFor + not.toBeInTheDocument() checks
Also applies to: 155-157, 164-165, 193-195, 208-210, 230-232, 277-281, 315-316, 323-324, 358-360, 373-375, 383-384, 412-414, 427-429, 436-437
src/screens/BlockUser/BlockUser.spec.tsx (1)
355-356
: LGTM! Proper implementation of async user interactions.The changes correctly await all userEvent interactions, improving test reliability.
Also applies to: 362-362, 385-386, 393-393, 509-510, 513-513, 517-517
src/screens/MemberDetail/MemberDetail.spec.tsx (1)
160-164
: LGTM! Proper implementation of async user interactions.The changes correctly await all userEvent interactions, improving test reliability.
Also applies to: 166-170, 172-176, 178-182, 184-185, 187-188, 190-191, 193-197, 199-201, 204-204, 283-284, 286-286, 394-394, 401-401, 403-407
src/components/AddPeopleToTag/AddPeopleToTag.spec.tsx (1)
202-202
: LGTM! Proper implementation of async user interactions.The changes correctly await all userEvent interactions, improving test reliability.
Also applies to: 207-207, 214-214, 219-219, 325-325, 341-341, 346-346, 351-351, 353-353, 424-425, 462-463
src/components/LeftDrawerOrg/LeftDrawerOrg.spec.tsx (1)
370-370
: LGTM!The changes correctly implement async/await pattern for userEvent methods as required by the upgraded package.
Also applies to: 393-393
src/screens/OrganizationEvents/OrganizationEvents.spec.tsx (1)
217-217
: LGTM!The changes correctly implement async/await pattern for userEvent methods as required by the upgraded package.
Also applies to: 225-225, 257-257, 263-266, 268-275, 287-288, 304-304, 354-354, 360-363, 364-367, 368-375, 387-390, 404-404, 409-409, 441-441, 447-450, 452-455, 457-460, 472-472, 489-489
src/components/AddOn/core/AddOnStore/AddOnStore.spec.tsx (1)
250-250
: LGTM!The changes correctly implement async/await pattern for userEvent methods as required by the upgraded package.
Also applies to: 253-253, 274-274
src/screens/ManageTag/ManageTag.spec.tsx (1)
130-130
: LGTM! Correctly addedawait
to userEvent interactions.The changes properly handle the asynchronous nature of userEvent interactions in the test suite. This is required for compatibility with the latest version of @testing-library/user-event.
Also applies to: 136-136, 153-153, 160-160, 177-177, 186-186, 203-203, 211-211, 227-227, 234-234, 251-251, 258-258, 275-275, 290-290, 307-307, 322-322, 377-377, 382-382, 394-394, 399-399, 448-448, 450-450, 467-467, 469-469, 476-476, 477-477, 480-480, 497-497, 499-499
src/components/UserPortal/CommentCard/CommentCard.spec.tsx (1)
226-226
: LGTM! Correctly addedawait
to userEvent.click interactions.The changes properly handle the asynchronous nature of userEvent.click interactions in the test suite. This is required for compatibility with the latest version of @testing-library/user-event.
Also applies to: 272-272, 305-305, 338-338, 378-378, 419-419, 460-460, 504-504, 544-544, 587-587
src/components/UserPortal/OrganizationNavbar/OrganizationNavbar.spec.tsx (1)
264-264
: LGTM! Correctly addedawait
to userEvent.click interactions.The changes properly handle the asynchronous nature of userEvent.click interactions in the test suite. This is required for compatibility with the latest version of @testing-library/user-event.
Also applies to: 285-285, 287-287, 315-315, 317-317, 339-339, 341-341, 363-363, 365-365, 387-387, 389-389, 517-517, 518-518, 540-540
src/screens/UserPortal/Organizations/Organizations.spec.tsx (1)
385-385
: LGTM! Correctly addedawait
to userEvent interactions.The changes properly handle the asynchronous nature of userEvent interactions (click, type, clear) in the test suite. This is required for compatibility with the latest version of @testing-library/user-event.
Also applies to: 390-390, 391-391, 414-414, 416-416, 441-441, 443-443, 488-488, 490-490, 570-570
src/components/RecurrenceOptions/RecurrenceOptions.spec.tsx (1)
106-106
: LGTM! Proper handling of asynchronous user interactions.The changes correctly await userEvent calls, which is essential when using @testing-library/user-event v14+. This ensures that all events in the interaction chain complete before moving to the next assertion.
Also applies to: 114-114, 144-144, 152-152, 158-158, 202-202, 208-208, 216-216, 267-267, 273-273, 279-279, 281-281, 287-287, 289-289, 297-297, 299-299, 307-309, 311-311, 319-321, 328-328, 334-334, 336-336, 344-344, 376-376, 382-385, 387-390, 392-395, 408-408, 429-429, 435-435, 441-441, 461-461, 497-497, 503-506, 508-511, 513-516, 529-529, 550-550, 556-556, 564-564, 586-586
src/components/UpdateSession/UpdateSession.spec.tsx (1)
115-116
: LGTM! Improved slider interaction testing.The changes enhance the test reliability by:
- Using fireEvent.mouseDown/mouseUp for precise control over slider interactions
- Adding waitFor to ensure slider value updates are complete before assertions
- Properly awaiting userEvent.click calls
Also applies to: 133-134, 151-152, 170-176, 227-227, 309-309
src/screens/OrgList/OrgList.spec.tsx (2)
113-113
: LGTM! Proper handling of asynchronous user events.The changes correctly await the userEvent actions, which is required by the newer version of @testing-library/user-event. The use of
userEvent.clear()
for clearing input is also a good practice.Also applies to: 135-135, 156-156
279-318
: LGTM! Proper handling of asynchronous user events in commented code.The changes in the commented-out test cases correctly await userEvent actions, maintaining consistency with the package upgrade requirements. This ensures the tests will work correctly when uncommented.
Also applies to: 381-419, 461-462, 482-484, 507-508
src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.spec.tsx (1)
583-583
: LGTM! Proper handling of asynchronous file uploads.The changes correctly await the file upload operations using userEvent, which is required by the newer version of @testing-library/user-event.
Also applies to: 640-640
src/screens/UserPortal/Events/Events.spec.tsx (1)
542-625
: LGTM! Proper handling of asynchronous form interactions.The changes correctly await all userEvent actions in the form interactions, which is required by the newer version of @testing-library/user-event. The test cases properly handle form inputs, checkboxes, and validations.
Also applies to: 679-764
src/screens/OrganizationActionItems/OrganizationActionItems.spec.tsx (1)
357-357
: LGTM! Proper handling of asynchronous user events.The changes correctly add
await
to alluserEvent
interactions, ensuring proper handling of asynchronous operations in the test cases. This is in line with the upgrade of@testing-library/user-event
package.Also applies to: 362-362, 394-394, 399-399, 431-431, 436-436, 468-468, 473-473, 505-505, 510-510, 543-543, 548-548, 553-553, 590-590, 595-595, 600-600
src/components/RecurrenceOptions/CustomRecurrence.spec.tsx (1)
103-103
: LGTM! Proper handling of asynchronous user events.The changes correctly add
await
to alluserEvent
interactions, ensuring proper handling of asynchronous operations in the test cases. This is in line with the upgrade of@testing-library/user-event
package.Also applies to: 111-111, 117-117, 123-123, 131-133, 138-138, 146-148, 153-153, 161-163, 168-168, 176-178, 183-183, 191-191, 252-254, 256-258, 357-357, 356-356, 357-357, 467-467, 525-528, 530-530, 561-561, 567-570, 571-575, 576-580, 592-592, 598-598, 604-604, 606-608, 613-613, 621-621, 628-630, 636-636, 662-662, 674-674, 710-710, 716-719, 721-724, 726-729, 754-754, 756-758, 763-763, 775-775
src/components/UserPortal/PostCard/PostCard.spec.tsx (1)
301-301
: LGTM! Proper handling of asynchronous user events.The changes correctly add
await
to alluserEvent
interactions, ensuring proper handling of asynchronous operations in the test cases. This is in line with the upgrade of@testing-library/user-event
package.Also applies to: 350-352, 355-357, 406-408, 510-511, 563-564, 656-657, 658-659, 708-710, 772-774, 859-859, 861-861, 946-946, 948-948
src/screens/Users/Users.spec.tsx (1)
145-146
: LGTM! Proper handling of asynchronous user events.The changes correctly add
await
to alluserEvent
interactions, ensuring proper handling of asynchronous operations in the test cases. This is in line with the upgrade of@testing-library/user-event
package.Also applies to: 151-151, 155-155, 158-158, 161-163, 188-195, 512-512, 515-515, 665-666, 775-778
src/components/OrgPostCard/OrgPostCard.spec.tsx (1)
167-703
: LGTM! The changes improve test reliability by properly handling asynchronous operations.The addition of
await
touserEvent
interactions ensures that user events are fully processed before assertions are made. This is particularly important when testing UI components where state changes need to be properly synchronized.src/screens/UserPortal/Donate/Donate.spec.tsx (1)
443-948
: LGTM! The changes improve test reliability by properly handling asynchronous operations.The addition of
await
touserEvent
interactions ensures that user events are fully processed before assertions are made. This is particularly important when testing UI components where state changes need to be properly synchronized.src/screens/UserPortal/People/People.spec.tsx (1)
255-932
: LGTM! The changes improve test reliability by properly handling asynchronous operations.The addition of
await
touserEvent
interactions ensures that user events are fully processed before assertions are made. This is particularly important when testing UI components where state changes need to be properly synchronized.src/components/EventListCard/EventListCard.spec.tsx (1)
118-956
: LGTM! The changes improve test reliability by properly handling asynchronous operations.The addition of
await
touserEvent
interactions ensures that user events are fully processed before assertions are made. This is particularly important when testing UI components where state changes need to be properly synchronized.src/screens/OrgPost/OrgPost.spec.tsx (1)
322-322
: LGTM! The async operations are now properly handled.The changes correctly add
await
to userEvent calls, ensuring proper handling of asynchronous operations after the package upgrade.Also applies to: 324-325, 350-351, 354-355, 373-373, 388-388, 406-407, 412-413, 463-463, 465-467, 468-483, 484-484, 487-487, 491-491, 627-627, 629-629, 650-650, 680-680, 702-702, 875-875, 877-878
src/screens/LoginPage/LoginPage.spec.tsx (1)
318-318
: LGTM! The async operations are now properly handled.The changes correctly add
await
to userEvent calls, ensuring proper handling of asynchronous operations after the package upgrade.Also applies to: 391-391, 395-404, 406-406, 431-431, 435-444, 445-445, 470-470, 472-481, 483-483, 508-508, 510-520, 522-522, 592-592, 594-605, 607-607, 631-631, 633-633, 658-662, 664-664, 689-693, 695-695, 722-722, 724-734, 736-736, 763-767, 769-769, 796-796, 820-820, 827-828, 830-831, 851-851, 858-859, 861-862, 902-902, 904-907, 934-934, 936-939, 966-966, 970-973, 998-998, 1004-1007, 1128-1129, 1215-1215
src/components/UsersTableItem/UserTableItem.spec.tsx (1)
1318-1321
: LGTM! The async operations are now properly handled.The changes correctly add
await
to userEvent calls, ensuring proper handling of asynchronous operations after the package upgrade.src/screens/OrganizationPeople/OrganizationPeople.spec.tsx (1)
830-834
: LGTM! Correctly awaited userEvent calls.The userEvent calls are properly awaited, which is required for @testing-library/user-event v14.
Also applies to: 840-847
src/components/EventManagement/EventAttendance/EventStatistics.spec.tsx
Outdated
Show resolved
Hide resolved
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #3569 +/- ##
====================================================
- Coverage 85.91% 85.87% -0.05%
====================================================
Files 342 342
Lines 8882 8882
Branches 1911 1911
====================================================
- Hits 7631 7627 -4
- Misses 906 913 +7
+ Partials 345 342 -3 ☔ View full report in Codecov by Sentry. |
4408384
into
PalisadoesFoundation:develop-postgres
Issue Number:
Fixes #2072
Summary
Does this PR introduce a breaking change?
No
Checklist
CodeRabbit AI Review
Test Coverage
Have you read the contributing guide?
Yes
Summary by CodeRabbit
• Chores
– Upgraded testing dependencies and updated our project configuration to leverage modern JavaScript standards for improved performance.
• Tests
– Enhanced the handling of asynchronous user interactions in our test suite to ensure greater stability and reliability.
These behind‐the-scenes improvements contribute to a more robust and consistent experience for our users.