diff --git a/src/frontend/js/components/TeacherDashboardCourseList/index.spec.tsx b/src/frontend/js/components/TeacherDashboardCourseList/index.spec.tsx index e94c38ea9c..41a43a343f 100644 --- a/src/frontend/js/components/TeacherDashboardCourseList/index.spec.tsx +++ b/src/frontend/js/components/TeacherDashboardCourseList/index.spec.tsx @@ -67,7 +67,7 @@ describe('components/TeacherDashboardCourseList', () => { await expectNoSpinner('Loading courses...'); expect( - screen.getByRole('heading', { name: /TeacherDashboardCourseList test title/ }), + await screen.findByRole('heading', { name: /TeacherDashboardCourseList test title/ }), ).toBeInTheDocument(); const calledUrls = fetchMock.calls().map((call) => call[0]); diff --git a/src/frontend/js/hooks/useDefaultOrganizationId/index.spec.tsx b/src/frontend/js/hooks/useDefaultOrganizationId/index.spec.tsx index bdb7ede73c..55024aabae 100644 --- a/src/frontend/js/hooks/useDefaultOrganizationId/index.spec.tsx +++ b/src/frontend/js/hooks/useDefaultOrganizationId/index.spec.tsx @@ -3,7 +3,7 @@ import fetchMock from 'fetch-mock'; import { RichieContextFactory as mockRichieContextFactory } from 'utils/test/factories/richie'; import { OrganizationFactory } from 'utils/test/factories/joanieLegacy'; import { Organization } from 'types/Joanie'; -import { JoanieAppWrapper, setupJoanieSession } from 'utils/test/wrappers/JoanieAppWrapper'; +import JoanieAppWrapper, { setupJoanieSession } from 'utils/test/wrappers/JoanieAppWrapper'; import useDefaultOrganizationId from '.'; jest.mock('utils/context', () => ({ diff --git a/src/frontend/js/pages/TeacherDashboardCourseLearnersLayout/hooks/useCourseLearnersFilters/index.spec.tsx b/src/frontend/js/pages/TeacherDashboardCourseLearnersLayout/hooks/useCourseLearnersFilters/index.spec.tsx index e29d389894..4241878507 100644 --- a/src/frontend/js/pages/TeacherDashboardCourseLearnersLayout/hooks/useCourseLearnersFilters/index.spec.tsx +++ b/src/frontend/js/pages/TeacherDashboardCourseLearnersLayout/hooks/useCourseLearnersFilters/index.spec.tsx @@ -6,7 +6,7 @@ import { CourseProductRelationFactory, OrganizationFactory, } from 'utils/test/factories/joanieLegacy'; -import { JoanieAppWrapper, setupJoanieSession } from 'utils/test/wrappers/JoanieAppWrapper'; +import JoanieAppWrapper, { setupJoanieSession } from 'utils/test/wrappers/JoanieAppWrapper'; import useCourseLearnersFilters from '.'; jest.mock('utils/context', () => ({ diff --git a/src/frontend/js/utils/test/render.tsx b/src/frontend/js/utils/test/render.tsx index 5df309d26d..852ff3165c 100644 --- a/src/frontend/js/utils/test/render.tsx +++ b/src/frontend/js/utils/test/render.tsx @@ -1,8 +1,9 @@ import { RenderResult, screen, render as testingLibraryRender } from '@testing-library/react'; -import React, { ReactElement } from 'react'; +import React, { ReactElement, lazy } from 'react'; import { Nullable } from 'types/utils'; import { AppWrapperProps } from './wrappers/types'; -import { JoanieAppWrapper } from './wrappers/JoanieAppWrapper'; + +const JoanieAppWrapper = lazy(() => import('./wrappers/JoanieAppWrapper')); // ------- setup ------- diff --git a/src/frontend/js/utils/test/wrappers/JoanieAppWrapper.tsx b/src/frontend/js/utils/test/wrappers/JoanieAppWrapper.tsx index 1ca3038e63..2745bef967 100644 --- a/src/frontend/js/utils/test/wrappers/JoanieAppWrapper.tsx +++ b/src/frontend/js/utils/test/wrappers/JoanieAppWrapper.tsx @@ -19,7 +19,7 @@ export const setupJoanieSession = () => { }; }; -export const JoanieAppWrapper = ({ +const JoanieAppWrapper = ({ children, intlOptions, queryOptions, @@ -35,3 +35,5 @@ export const JoanieAppWrapper = ({ ); }; + +export default JoanieAppWrapper;