Skip to content

Commit

Permalink
Fixed event check in management not updating automatically bug (#1062)
Browse files Browse the repository at this point in the history
* fixed the event checkIn bug

* fixed the failing test

* fixed the CheckInWrapper test
  • Loading branch information
kanhaiya04 authored Nov 16, 2023
1 parent 8519c15 commit 63b2269
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/components/CheckIn/CheckInModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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(
<MockedProvider addTypename={false} mocks={checkInQueryMock}>
<MockedProvider addTypename={false} link={link}>
<BrowserRouter>
<LocalizationProvider dateAdapter={AdapterDayjs}>
<Provider store={store}>
Expand Down
1 change: 1 addition & 0 deletions src/components/CheckIn/CheckInModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const CheckInModal = (props: InterfaceModalProp): JSX.Element => {
});

useEffect(() => {
checkInRefetch();
if (checkInLoading) setTableData([]);
else
setTableData(
Expand Down
5 changes: 4 additions & 1 deletion src/components/CheckIn/CheckInWrapper.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -19,7 +22,7 @@ describe('Testing CheckIn Wrapper', () => {

test('The button to open and close the modal should work properly', async () => {
const { queryByText } = render(
<MockedProvider addTypename={false} mocks={checkInQueryMock}>
<MockedProvider addTypename={false} link={link}>
<BrowserRouter>
<LocalizationProvider dateAdapter={AdapterDayjs}>
<Provider store={store}>
Expand Down

0 comments on commit 63b2269

Please sign in to comment.