diff --git a/src/screens/OrgList/OrgList.test.tsx b/src/screens/OrgList/OrgList.test.tsx index 6062cd7dae..5d716dd065 100644 --- a/src/screens/OrgList/OrgList.test.tsx +++ b/src/screens/OrgList/OrgList.test.tsx @@ -1,6 +1,12 @@ import React from 'react'; import { MockedProvider } from '@apollo/react-testing'; -import { act, render, screen, fireEvent } from '@testing-library/react'; +import { + act, + render, + screen, + fireEvent, + cleanup, +} from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import 'jest-localstorage-mock'; import 'jest-location-mock'; @@ -11,6 +17,7 @@ import { store } from 'state/store'; import { StaticMockLink } from 'utils/StaticMockLink'; import i18nForTest from 'utils/i18nForTest'; import OrgList from './OrgList'; + import { MOCKS, MOCKS_ADMIN, MOCKS_EMPTY } from './OrgListMocks'; async function wait(ms = 100): Promise { @@ -23,6 +30,7 @@ async function wait(ms = 100): Promise { afterEach(() => { localStorage.clear(); + cleanup(); }); describe('Organisations Page testing as SuperAdmin', () => { diff --git a/src/screens/OrgList/OrgList.tsx b/src/screens/OrgList/OrgList.tsx index 6a138b0e41..645afd8e0b 100644 --- a/src/screens/OrgList/OrgList.tsx +++ b/src/screens/OrgList/OrgList.tsx @@ -31,17 +31,6 @@ import type { } from 'utils/interfaces'; import styles from './OrgList.module.css'; -interface InterfaceOrgList { - _id: string; - name: string; - image: string | null; - location: string; - admins: { _id: string }[]; - members: { _id: string }[]; - creator: { _id: string; firstName: string; lastName: string }; - createdAt: string; -} - function orgList(): JSX.Element { const { t } = useTranslation('translation', { keyPrefix: 'orgList' }); const [dialogModalisOpen, setdialogModalIsOpen] = useState(false); @@ -299,9 +288,9 @@ function orgList(): JSX.Element { }; const sortOrgs = ( - orgs: InterfaceOrgList[], + orgs: InterfaceOrgConnectionInfoType[], sortingOption: string - ): InterfaceOrgList[] => { + ): InterfaceOrgConnectionInfoType[] => { const sortedOrgs = [...orgs]; if (sortingOption === 'latest') {