From 30bbb99d195b93887545284d08d193615635a32d Mon Sep 17 00:00:00 2001 From: Gurram Karthik <167804249+gurramkarthiknetha@users.noreply.github.com> Date: Sat, 11 Jan 2025 23:16:56 +0530 Subject: [PATCH] changed according to coderabbitai --- .../Advertisements/Advertisements.spec.tsx | 2 +- .../AdvertisementRegister.spec.tsx | 4 +-- .../EditCustomFieldDropDown.spec.tsx | 9 +++---- .../General/OrgUpdate/OrgUpdate.spec.tsx | 8 +++--- .../CustomRecurrence.spec.tsx | 12 ++++----- .../UserPortal/PostCard/PostCard.spec.tsx | 2 +- .../UsersTableItem/UserTableItem.spec.tsx | 4 +-- src/components/Venues/VenueModal.spec.tsx | 4 +-- src/screens/BlockUser/BlockUser.spec.tsx | 4 +-- .../CommunityProfile.spec.tsx | 2 +- .../VolunteerGroupModal.spec.tsx | 2 +- src/screens/ManageTag/ManageTag.spec.tsx | 2 +- .../MemberDetail/MemberDetail.spec.tsx | 20 +++++++------- src/screens/OrgList/OrgList.spec.tsx | 6 ++--- src/screens/OrgPost/OrgPost.test.tsx | 26 ++++++++++++++----- src/screens/Requests/Requests.spec.tsx | 2 +- .../Organizations/Organizations.spec.tsx | 2 +- src/screens/UserPortal/Posts/Posts.spec.tsx | 2 +- .../UserPortal/Settings/Settings.spec.tsx | 18 ++++++++----- .../Volunteer/Groups/GroupModal.spec.tsx | 2 +- src/screens/Users/Users.spec.tsx | 4 +-- tsconfig.json | 2 +- 22 files changed, 77 insertions(+), 62 deletions(-) diff --git a/src/components/Advertisements/Advertisements.spec.tsx b/src/components/Advertisements/Advertisements.spec.tsx index d62ee5ff71..fcd649a92f 100644 --- a/src/components/Advertisements/Advertisements.spec.tsx +++ b/src/components/Advertisements/Advertisements.spec.tsx @@ -407,7 +407,7 @@ describe('Testing Advertisement Component', () => { }); const mediaPreview = await screen.findByTestId('mediaPreview'); expect(mediaPreview).toBeInTheDocument(); - userEvent.selectOptions( + await userEvent.selectOptions( screen.getByLabelText('Select type of Advertisement'), 'POPUP', ); diff --git a/src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.spec.tsx b/src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.spec.tsx index 80ef45226f..350015c449 100644 --- a/src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.spec.tsx +++ b/src/components/Advertisements/core/AdvertisementRegister/AdvertisementRegister.spec.tsx @@ -580,7 +580,7 @@ describe('Testing Advertisement Register Component', () => { type: 'video/mp4', }); const mediaInput = screen.getByTestId('advertisementMedia'); - userEvent.upload(mediaInput, mediaFile); + await userEvent.upload(mediaInput, mediaFile); const mediaPreview = await screen.findByTestId('mediaPreview'); expect(mediaPreview).toBeInTheDocument(); @@ -637,7 +637,7 @@ describe('Testing Advertisement Register Component', () => { type: 'video/mp4', }); const mediaInput = screen.getByTestId('advertisementMedia'); - userEvent.upload(mediaInput, mediaFile); + await userEvent.upload(mediaInput, mediaFile); const mediaPreview = await screen.findByTestId('mediaPreview'); expect(mediaPreview).toBeInTheDocument(); diff --git a/src/components/EditCustomFieldDropDown/EditCustomFieldDropDown.spec.tsx b/src/components/EditCustomFieldDropDown/EditCustomFieldDropDown.spec.tsx index b83b3892cf..39e6c1c9f5 100644 --- a/src/components/EditCustomFieldDropDown/EditCustomFieldDropDown.spec.tsx +++ b/src/components/EditCustomFieldDropDown/EditCustomFieldDropDown.spec.tsx @@ -54,11 +54,8 @@ describe('Testing Custom Field Dropdown', () => { }); await wait(); - - availableFieldTypes.forEach(async (_, index) => { - act(async () => { - await userEvent.click(getByTestId(`dropdown-btn-${index}`)); - }); - }); + for (const [index] of availableFieldTypes.entries()) { + await userEvent.click(getByTestId(`dropdown-btn-${index}`)); + } }); }); diff --git a/src/components/OrgSettings/General/OrgUpdate/OrgUpdate.spec.tsx b/src/components/OrgSettings/General/OrgUpdate/OrgUpdate.spec.tsx index 26c96639c6..f7ef95d54e 100644 --- a/src/components/OrgSettings/General/OrgUpdate/OrgUpdate.spec.tsx +++ b/src/components/OrgSettings/General/OrgUpdate/OrgUpdate.spec.tsx @@ -152,13 +152,13 @@ describe('Testing Organization Update', () => { await userEvent.type(name, formData.name); await userEvent.type(des, formData.description); await userEvent.type(city, formData.address.city); - userEvent.selectOptions(countryCode, formData.address.countryCode); + await userEvent.selectOptions(countryCode, formData.address.countryCode); await userEvent.type(line1, formData.address.line1); await userEvent.type(line2, formData.address.line2); await userEvent.type(postalCode, formData.address.postalCode); await userEvent.type(dependentLocality, formData.address.dependentLocality); await userEvent.type(sortingCode, formData.address.sortingCode); - userEvent.upload(displayImage, formData.displayImage); + await userEvent.upload(displayImage, formData.displayImage); await userEvent.click(userRegistrationRequired); await userEvent.click(isVisible); @@ -238,13 +238,13 @@ describe('Testing Organization Update', () => { await userEvent.type(name, formData.name); await userEvent.type(des, formData.description); await userEvent.type(city, formData.address.city); - userEvent.selectOptions(countryCode, formData.address.countryCode); + await userEvent.selectOptions(countryCode, formData.address.countryCode); await userEvent.type(line1, formData.address.line1); await userEvent.type(line2, formData.address.line2); await userEvent.type(postalCode, formData.address.postalCode); await userEvent.type(dependentLocality, formData.address.dependentLocality); await userEvent.type(sortingCode, formData.address.sortingCode); - userEvent.upload(displayImage, formData.displayImage); + await userEvent.upload(displayImage, formData.displayImage); await userEvent.click(userRegistrationRequired); await userEvent.click(isVisible); diff --git a/src/components/RecurrenceOptions/CustomRecurrence.spec.tsx b/src/components/RecurrenceOptions/CustomRecurrence.spec.tsx index b94c8d140e..9bec66a9c6 100644 --- a/src/components/RecurrenceOptions/CustomRecurrence.spec.tsx +++ b/src/components/RecurrenceOptions/CustomRecurrence.spec.tsx @@ -249,13 +249,13 @@ describe('Testing the creaction of recurring events with custom recurrence patte const weekDaysOptions = screen.getAllByTestId('recurrenceWeekDay'); - weekDaysOptions.forEach(async (weekDay) => { - await userEvent.click(weekDay); - }); + await Promise.all( + weekDaysOptions.map((weekDay) => userEvent.click(weekDay)), + ); - weekDaysOptions.forEach(async (weekDay) => { - await userEvent.click(weekDay); - }); + await Promise.all( + weekDaysOptions.map((weekDay) => userEvent.click(weekDay)), + ); await userEvent.click(screen.getByTestId('customRecurrenceSubmitBtn')); await waitFor(() => { diff --git a/src/components/UserPortal/PostCard/PostCard.spec.tsx b/src/components/UserPortal/PostCard/PostCard.spec.tsx index 0224bcc618..fde64871be 100644 --- a/src/components/UserPortal/PostCard/PostCard.spec.tsx +++ b/src/components/UserPortal/PostCard/PostCard.spec.tsx @@ -352,7 +352,7 @@ describe('Testing PostCard Component [User Portal]', () => { await wait(); expect(screen.getByTestId('editPostModalTitle')).toBeInTheDocument(); - userEvent.clear(screen.getByTestId('postInput')); + await userEvent.clear(screen.getByTestId('postInput')); await userEvent.type(screen.getByTestId('postInput'), 'Edited Post'); await userEvent.click(screen.getByTestId('editPostBtn')); await wait(); diff --git a/src/components/UsersTableItem/UserTableItem.spec.tsx b/src/components/UsersTableItem/UserTableItem.spec.tsx index a0b0c39c86..c551ceb4dc 100644 --- a/src/components/UsersTableItem/UserTableItem.spec.tsx +++ b/src/components/UsersTableItem/UserTableItem.spec.tsx @@ -1315,9 +1315,9 @@ describe('Testing User Table Item', () => { `changeRoleInOrg${'abc'}`, ) as HTMLSelectElement; expect(changeRoleBtn).toBeInTheDocument(); - userEvent.selectOptions(changeRoleBtn, 'ADMIN'); + await userEvent.selectOptions(changeRoleBtn, 'ADMIN'); await wait(); - userEvent.selectOptions(changeRoleBtn, 'USER'); + await userEvent.selectOptions(changeRoleBtn, 'USER'); await wait(); expect(changeRoleBtn.value).toBe(`USER?abc`); await wait(); diff --git a/src/components/Venues/VenueModal.spec.tsx b/src/components/Venues/VenueModal.spec.tsx index c840b6de53..3f9a43b162 100644 --- a/src/components/Venues/VenueModal.spec.tsx +++ b/src/components/Venues/VenueModal.spec.tsx @@ -177,7 +177,7 @@ describe('VenueModal', () => { const file = new File(['chad'], 'chad.png', { type: 'image/png' }); const fileInput = screen.getByTestId('venueImgUrl'); - userEvent.upload(fileInput, file); + await userEvent.upload(fileInput, file); await wait(); @@ -190,7 +190,7 @@ describe('VenueModal', () => { const file = new File(['chad'], 'chad.png', { type: 'image/png' }); const fileInput = screen.getByTestId('venueImgUrl'); - userEvent.upload(fileInput, file); + await userEvent.upload(fileInput, file); await wait(); diff --git a/src/screens/BlockUser/BlockUser.spec.tsx b/src/screens/BlockUser/BlockUser.spec.tsx index 9d7c07cd9a..c0aaafc4d6 100644 --- a/src/screens/BlockUser/BlockUser.spec.tsx +++ b/src/screens/BlockUser/BlockUser.spec.tsx @@ -483,11 +483,11 @@ describe('Testing Block/Unblock user screen', () => { expect(searchBar).toBeInTheDocument(); await userEvent.type(searchBar, 'Dummy{enter}'); await wait(); - userEvent.clear(searchBar); + await userEvent.clear(searchBar); await userEvent.type(searchBar, 'Dummy'); await userEvent.click(searchBtn); await wait(); - userEvent.clear(searchBar); + await userEvent.clear(searchBar); await userEvent.type(searchBar, ''); await userEvent.click(searchBtn); }); diff --git a/src/screens/CommunityProfile/CommunityProfile.spec.tsx b/src/screens/CommunityProfile/CommunityProfile.spec.tsx index 6a5973269e..a15ca6b722 100644 --- a/src/screens/CommunityProfile/CommunityProfile.spec.tsx +++ b/src/screens/CommunityProfile/CommunityProfile.spec.tsx @@ -238,7 +238,7 @@ describe('Testing Community Profile Screen', () => { await userEvent.type(youtube, profileVariables.socialUrl); await userEvent.type(reddit, profileVariables.socialUrl); await userEvent.type(slack, profileVariables.socialUrl); - userEvent.upload(logo, profileVariables.logo); + await userEvent.upload(logo, profileVariables.logo); await wait(); expect(communityName).toHaveValue(profileVariables.name); diff --git a/src/screens/EventVolunteers/VolunteerGroups/VolunteerGroupModal.spec.tsx b/src/screens/EventVolunteers/VolunteerGroups/VolunteerGroupModal.spec.tsx index 566a78f1b3..d0a6e9296d 100644 --- a/src/screens/EventVolunteers/VolunteerGroups/VolunteerGroupModal.spec.tsx +++ b/src/screens/EventVolunteers/VolunteerGroups/VolunteerGroupModal.spec.tsx @@ -323,7 +323,7 @@ describe('Testing VolunteerGroupModal', () => { expect(vrInput).toHaveValue(''); }); - userEvent.clear(vrInput); + await userEvent.clear(vrInput); await userEvent.type(vrInput, '1{backspace}'); await waitFor(() => { diff --git a/src/screens/ManageTag/ManageTag.spec.tsx b/src/screens/ManageTag/ManageTag.spec.tsx index 5e97b1be8a..842b532ba8 100644 --- a/src/screens/ManageTag/ManageTag.spec.tsx +++ b/src/screens/ManageTag/ManageTag.spec.tsx @@ -466,7 +466,7 @@ describe('Manage Tag Page', () => { }); const tagNameInput = screen.getByTestId('tagNameInput'); - await userEvent.clear(tagNameInput); + await await userEvent.clear(tagNameInput); await userEvent.type(tagNameInput, 'tag 1 edited'); expect(tagNameInput).toHaveValue('tag 1 edited'); diff --git a/src/screens/MemberDetail/MemberDetail.spec.tsx b/src/screens/MemberDetail/MemberDetail.spec.tsx index 0d0af59a7a..a2febe43de 100644 --- a/src/screens/MemberDetail/MemberDetail.spec.tsx +++ b/src/screens/MemberDetail/MemberDetail.spec.tsx @@ -164,48 +164,48 @@ describe('MemberDetail', () => { target: { value: formData.birthDate }, }); - userEvent.clear(screen.getByPlaceholderText(/First Name/i)); + await userEvent.clear(screen.getByPlaceholderText(/First Name/i)); await userEvent.type( screen.getByPlaceholderText(/First Name/i), formData.firstName, ); - userEvent.clear(screen.getByPlaceholderText(/Last Name/i)); + await userEvent.clear(screen.getByPlaceholderText(/Last Name/i)); await userEvent.type( screen.getByPlaceholderText(/Last Name/i), formData.lastName, ); - userEvent.clear(screen.getByPlaceholderText(/Address/i)); + await userEvent.clear(screen.getByPlaceholderText(/Address/i)); await userEvent.type( screen.getByPlaceholderText(/Address/i), formData.address, ); - userEvent.clear(screen.getByPlaceholderText(/Country Code/i)); + await userEvent.clear(screen.getByPlaceholderText(/Country Code/i)); await userEvent.type( screen.getByPlaceholderText(/Country Code/i), formData.countryCode, ); - userEvent.clear(screen.getByPlaceholderText(/State/i)); + await userEvent.clear(screen.getByPlaceholderText(/State/i)); await userEvent.type(screen.getByPlaceholderText(/State/i), formData.state); - userEvent.clear(screen.getByPlaceholderText(/City/i)); + await userEvent.clear(screen.getByPlaceholderText(/City/i)); await userEvent.type(screen.getByPlaceholderText(/City/i), formData.city); - userEvent.clear(screen.getByPlaceholderText(/Email/i)); + await userEvent.clear(screen.getByPlaceholderText(/Email/i)); await userEvent.type(screen.getByPlaceholderText(/Email/i), formData.email); - userEvent.clear(screen.getByPlaceholderText(/Phone/i)); + await userEvent.clear(screen.getByPlaceholderText(/Phone/i)); await userEvent.type( screen.getByPlaceholderText(/Phone/i), formData.phoneNumber, ); // await userEvent.click(screen.getByPlaceholderText(/pluginCreationAllowed/i)); - // userEvent.selectOptions(screen.getByTestId('applangcode'), 'Français'); - // userEvent.upload(screen.getByLabelText(/Display Image:/i), formData.image); + // await userEvent.selectOptions(screen.getByTestId('applangcode'), 'Français'); + // await userEvent.upload(screen.getByLabelText(/Display Image:/i), formData.image); await wait(); await userEvent.click(screen.getByText(/Save Changes/i)); diff --git a/src/screens/OrgList/OrgList.spec.tsx b/src/screens/OrgList/OrgList.spec.tsx index 65872f7cc2..4afdc61bdd 100644 --- a/src/screens/OrgList/OrgList.spec.tsx +++ b/src/screens/OrgList/OrgList.spec.tsx @@ -260,7 +260,7 @@ describe('Organisations Page testing as SuperAdmin', () => { formData.address.state, ); - userEvent.selectOptions( + await userEvent.selectOptions( screen.getByTestId('countrycode'), formData.address.countryCode, ); @@ -311,7 +311,7 @@ describe('Organisations Page testing as SuperAdmin', () => { expect(screen.getByTestId(/visibleInSearch/i)).toBeChecked(); expect(screen.getByLabelText(/Display Image/i)).toBeTruthy(); const displayImage = screen.getByTestId('organisationImage'); - userEvent.upload(displayImage, formData.image); + await userEvent.upload(displayImage, formData.image); await userEvent.click(screen.getByTestId(/submitOrganizationForm/i)); await waitFor(() => { expect( @@ -367,7 +367,7 @@ describe('Organisations Page testing as SuperAdmin', () => { screen.getByPlaceholderText(/Postal Code/i), formData.address.postalCode, ); - userEvent.selectOptions( + await userEvent.selectOptions( screen.getByTestId('countrycode'), formData.address.countryCode, ); diff --git a/src/screens/OrgPost/OrgPost.test.tsx b/src/screens/OrgPost/OrgPost.test.tsx index d354bddc4f..120831394b 100644 --- a/src/screens/OrgPost/OrgPost.test.tsx +++ b/src/screens/OrgPost/OrgPost.test.tsx @@ -233,10 +233,22 @@ describe('Organisation Post Page', () => { await userEvent.type(screen.getByTestId('modalTitle'), formData.posttitle); await userEvent.type(screen.getByTestId('modalinfo'), formData.postinfo); - userEvent.upload(screen.getByTestId('addMediaField'), formData.postImage); - userEvent.upload(screen.getByTestId('addMediaField'), formData.postVideo); - userEvent.upload(screen.getByTestId('addMediaField'), formData.postImage); - userEvent.upload(screen.getByTestId('addMediaField'), formData.postVideo); + await userEvent.upload( + screen.getByTestId('addMediaField'), + formData.postImage, + ); + await userEvent.upload( + screen.getByTestId('addMediaField'), + formData.postVideo, + ); + await userEvent.upload( + screen.getByTestId('addMediaField'), + formData.postImage, + ); + await userEvent.upload( + screen.getByTestId('addMediaField'), + formData.postVideo, + ); await userEvent.click(screen.getByTestId('pinPost')); expect(screen.getByTestId('pinPost')).toBeChecked(); @@ -449,7 +461,7 @@ describe('Organisation Post Page', () => { type: 'image/png', }); const imageInput = screen.getByTestId('addMediaField'); - userEvent.upload(imageInput, imageFile); + await userEvent.upload(imageInput, imageFile); // Check if the image is displayed const imagePreview = await screen.findByAltText('Post Image Preview'); @@ -574,7 +586,7 @@ describe('Organisation Post Page', () => { type: 'image/png', }); const input = screen.getByTestId('addMediaField'); - userEvent.upload(input, file); + await userEvent.upload(input, file); await screen.findByAltText('Post Image Preview'); expect(screen.getByAltText('Post Image Preview')).toBeInTheDocument(); @@ -620,7 +632,7 @@ describe('Organisation Post Page', () => { }); await act(async () => { - userEvent.upload(screen.getByTestId('addMediaField'), videoFile); + await userEvent.upload(screen.getByTestId('addMediaField'), videoFile); }); // Check if the video is displayed diff --git a/src/screens/Requests/Requests.spec.tsx b/src/screens/Requests/Requests.spec.tsx index 1b3c9b37c9..53f1910dd1 100644 --- a/src/screens/Requests/Requests.spec.tsx +++ b/src/screens/Requests/Requests.spec.tsx @@ -190,7 +190,7 @@ describe('Testing Requests screen', () => { const search5 = 'Xe'; await userEvent.type(screen.getByTestId(/searchByName/i), search5); - userEvent.clear(screen.getByTestId(/searchByName/i)); + await userEvent.clear(screen.getByTestId(/searchByName/i)); await userEvent.type(screen.getByTestId(/searchByName/i), ''); await userEvent.click(searchBtn); await wait(); diff --git a/src/screens/UserPortal/Organizations/Organizations.spec.tsx b/src/screens/UserPortal/Organizations/Organizations.spec.tsx index 7de6c83155..ad6fcc0b4c 100644 --- a/src/screens/UserPortal/Organizations/Organizations.spec.tsx +++ b/src/screens/UserPortal/Organizations/Organizations.spec.tsx @@ -385,7 +385,7 @@ describe('Testing Organizations Screen [User Portal]', () => { expect(screen.queryByText('anyOrganization2')).toBeInTheDocument(); - userEvent.clear(screen.getByTestId('searchInput')); + await userEvent.clear(screen.getByTestId('searchInput')); await userEvent.click(searchBtn); await wait(); }); diff --git a/src/screens/UserPortal/Posts/Posts.spec.tsx b/src/screens/UserPortal/Posts/Posts.spec.tsx index a28e95706a..7c77f69ee0 100644 --- a/src/screens/UserPortal/Posts/Posts.spec.tsx +++ b/src/screens/UserPortal/Posts/Posts.spec.tsx @@ -318,7 +318,7 @@ describe('Testing Home Screen: User Portal', () => { renderHomeScreen(); await wait(); - userEvent.upload( + await userEvent.upload( screen.getByTestId('postImageInput'), new File(['image content'], 'image.png', { type: 'image/png' }), ); diff --git a/src/screens/UserPortal/Settings/Settings.spec.tsx b/src/screens/UserPortal/Settings/Settings.spec.tsx index 5f7a3e4c0c..0d6224619e 100644 --- a/src/screens/UserPortal/Settings/Settings.spec.tsx +++ b/src/screens/UserPortal/Settings/Settings.spec.tsx @@ -258,21 +258,27 @@ describe('Testing Settings Screen [User Portal]', () => { await wait(); await userEvent.type(screen.getByTestId('inputLastName'), 'Mittal'); await wait(); - userEvent.selectOptions(screen.getByTestId('inputGender'), 'Male'); + await userEvent.selectOptions(screen.getByTestId('inputGender'), 'Male'); await wait(); await userEvent.type(screen.getByTestId('inputPhoneNumber'), '1234567890'); await wait(); - userEvent.selectOptions(screen.getByTestId('inputGrade'), 'Grade-1'); + await userEvent.selectOptions(screen.getByTestId('inputGrade'), 'Grade-1'); await wait(); - userEvent.selectOptions(screen.getByTestId('inputEmpStatus'), 'Unemployed'); + await userEvent.selectOptions( + screen.getByTestId('inputEmpStatus'), + 'Unemployed', + ); await wait(); - userEvent.selectOptions(screen.getByTestId('inputMaritalStatus'), 'Single'); + await userEvent.selectOptions( + screen.getByTestId('inputMaritalStatus'), + 'Single', + ); await wait(); await userEvent.type(screen.getByTestId('inputAddress'), 'random'); await wait(); await userEvent.type(screen.getByTestId('inputState'), 'random'); await wait(); - userEvent.selectOptions(screen.getByTestId('inputCountry'), 'IN'); + await userEvent.selectOptions(screen.getByTestId('inputCountry'), 'IN'); await wait(); expect(screen.getByTestId('resetChangesBtn')).toBeInTheDocument(); await wait(); @@ -289,7 +295,7 @@ describe('Testing Settings Screen [User Portal]', () => { type: 'image/jpeg', }); const files = [imageFile]; - userEvent.upload(fileInp, files); + await userEvent.upload(fileInp, files); await wait(); expect(screen.getByTestId('profile-picture')).toBeInTheDocument(); }); diff --git a/src/screens/UserPortal/Volunteer/Groups/GroupModal.spec.tsx b/src/screens/UserPortal/Volunteer/Groups/GroupModal.spec.tsx index 7222c322a8..87beb4624c 100644 --- a/src/screens/UserPortal/Volunteer/Groups/GroupModal.spec.tsx +++ b/src/screens/UserPortal/Volunteer/Groups/GroupModal.spec.tsx @@ -285,7 +285,7 @@ describe('Testing GroupModal', () => { expect(vrInput).toHaveValue(''); }); - userEvent.clear(vrInput); + await userEvent.clear(vrInput); await userEvent.type(vrInput, '1{backspace}'); await waitFor(() => { diff --git a/src/screens/Users/Users.spec.tsx b/src/screens/Users/Users.spec.tsx index 7b5ffdc4d1..0062862860 100644 --- a/src/screens/Users/Users.spec.tsx +++ b/src/screens/Users/Users.spec.tsx @@ -979,7 +979,7 @@ describe('Testing Users screen', () => { const search5 = 'Xe'; await userEvent.type(screen.getByTestId(/searchByName/i), search5); - userEvent.clear(screen.getByTestId(/searchByName/i)); + await userEvent.clear(screen.getByTestId(/searchByName/i)); await userEvent.type(screen.getByTestId(/searchByName/i), ''); await userEvent.click(searchBtn); await wait(); @@ -1006,7 +1006,7 @@ describe('Testing Users screen', () => { await act(async () => { // Clear the search input - userEvent.clear(searchInput); + await userEvent.clear(searchInput); // Search for a name that doesn't exist await userEvent.type( screen.getByTestId(/searchByName/i), diff --git a/tsconfig.json b/tsconfig.json index 7e0274edb2..e5c9f98cdb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "types": ["vite/client", "vite-plugin-svgr/client", "node"], "baseUrl": "src", - "target": "es5", + "target": "ES2015", "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true,