From b18f150f4f829ff1130c0612a9eccc4ffec67f21 Mon Sep 17 00:00:00 2001 From: im-vedant <194vedantgutpa@gmail.com> Date: Mon, 30 Dec 2024 02:08:39 +0530 Subject: [PATCH] improve code coverage --- .../OrganizationAgendaCategory.spec.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/OrgSettings/AgendaItemCategories/OrganizationAgendaCategory.spec.tsx b/src/components/OrgSettings/AgendaItemCategories/OrganizationAgendaCategory.spec.tsx index 53bf8e8aaf..4ba81275ec 100644 --- a/src/components/OrgSettings/AgendaItemCategories/OrganizationAgendaCategory.spec.tsx +++ b/src/components/OrgSettings/AgendaItemCategories/OrganizationAgendaCategory.spec.tsx @@ -5,6 +5,7 @@ import { waitFor, act, waitForElementToBeRemoved, + fireEvent, } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { MockedProvider } from '@apollo/client/testing'; @@ -286,7 +287,11 @@ describe('Testing Agenda Categories Component', () => { const searchInput = await screen.findByTestId('searchByName'); expect(searchInput).toBeInTheDocument(); - userEvent.type(searchInput, 'Category[Enter]'); + userEvent.type(searchInput, 'Category'); + await act(async () => { + fireEvent.keyUp(searchInput, { key: 'Enter' }); + }); + screen.debug(); await waitFor(() => { expect(screen.getAllByText('Category').length).toBe(2); });