From 63b2269d1e0fd69f7dc34d21c1a09a4485f449aa Mon Sep 17 00:00:00 2001 From: Kanhaiya yadav <93936630+kanhaiya04@users.noreply.github.com> Date: Thu, 16 Nov 2023 19:21:39 +0530 Subject: [PATCH] Fixed event check in management not updating automatically bug (#1062) * fixed the event checkIn bug * fixed the failing test * fixed the CheckInWrapper test --- src/components/CheckIn/CheckInModal.test.tsx | 5 ++++- src/components/CheckIn/CheckInModal.tsx | 1 + src/components/CheckIn/CheckInWrapper.test.tsx | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/CheckIn/CheckInModal.test.tsx b/src/components/CheckIn/CheckInModal.test.tsx index 11d95e5885..80fe9dd918 100644 --- a/src/components/CheckIn/CheckInModal.test.tsx +++ b/src/components/CheckIn/CheckInModal.test.tsx @@ -11,6 +11,9 @@ import { ToastContainer } from 'react-toastify'; import { LocalizationProvider } from '@mui/x-date-pickers'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; import { checkInQueryMock } from './mocks'; +import { StaticMockLink } from 'utils/StaticMockLink'; + +const link = new StaticMockLink(checkInQueryMock, true); describe('Testing Check In Attendees Modal', () => { const props = { @@ -21,7 +24,7 @@ describe('Testing Check In Attendees Modal', () => { test('The modal should be rendered, and all the fetched users should be shown properly and user filtering should work', async () => { const { queryByText, queryByLabelText } = render( - + diff --git a/src/components/CheckIn/CheckInModal.tsx b/src/components/CheckIn/CheckInModal.tsx index a370ebbb7e..3f15824ecd 100644 --- a/src/components/CheckIn/CheckInModal.tsx +++ b/src/components/CheckIn/CheckInModal.tsx @@ -30,6 +30,7 @@ export const CheckInModal = (props: InterfaceModalProp): JSX.Element => { }); useEffect(() => { + checkInRefetch(); if (checkInLoading) setTableData([]); else setTableData( diff --git a/src/components/CheckIn/CheckInWrapper.test.tsx b/src/components/CheckIn/CheckInWrapper.test.tsx index 4deadc81d6..9cb7fef4ba 100644 --- a/src/components/CheckIn/CheckInWrapper.test.tsx +++ b/src/components/CheckIn/CheckInWrapper.test.tsx @@ -11,6 +11,9 @@ import { ToastContainer } from 'react-toastify'; import { LocalizationProvider } from '@mui/x-date-pickers'; import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs'; import { checkInQueryMock } from './mocks'; +import { StaticMockLink } from 'utils/StaticMockLink'; + +const link = new StaticMockLink(checkInQueryMock, true); describe('Testing CheckIn Wrapper', () => { const props = { @@ -19,7 +22,7 @@ describe('Testing CheckIn Wrapper', () => { test('The button to open and close the modal should work properly', async () => { const { queryByText } = render( - +