Skip to content

Commit 368aa58

Browse files
committed
test: Fix broken tests
1 parent cbee617 commit 368aa58

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/library-authoring/import-course/stepper/ImportStepperPage.test.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { LibraryProvider } from '@src/library-authoring/common/context/LibraryCo
1414
import { mockContentLibrary, mockGetMigrationInfo } from '@src/library-authoring/data/api.mocks';
1515
import { useGetBlockTypes } from '@src/search-manager';
1616
import { bulkModulestoreMigrateUrl } from '@src/data/api';
17+
import { useLibraryBlockLimits } from '@src/library-authoring/data/apiHooks';
1718
import { ImportStepperPage } from './ImportStepperPage';
1819

1920
let axiosMock;
@@ -37,6 +38,11 @@ jest.mock('@src/search-manager', () => ({
3738
useGetContentHits: jest.fn().mockReturnValue({ isPending: true, data: null }),
3839
}));
3940

41+
jest.mock('@src/library-authoring/data/apiHooks', () => ({
42+
...jest.requireActual('@src/library-authoring/data/apiHooks'),
43+
useLibraryBlockLimits: jest.fn().mockReturnValue({ isPending: true, data: null }),
44+
}));
45+
4046
const renderComponent = (studioHomeState: Partial<StudioHomeState> = {}) => {
4147
// Generate a custom initial state based on studioHomeCoursesRequestParams
4248
const customInitialState: Partial<DeprecatedReduxState> = {
@@ -106,6 +112,10 @@ describe('<ImportStepperModal />', () => {
106112
});
107113

108114
it('should go to review import details step', async () => {
115+
(useLibraryBlockLimits as jest.Mock).mockReturnValue({
116+
isPending: false,
117+
data: { maxBlocksPerContentLibrary: 100 },
118+
});
109119
const user = userEvent.setup();
110120
renderComponent();
111121
axiosMock.onGet(getCourseDetailsApiUrl('course-v1:HarvardX+123+2023')).reply(200, {

0 commit comments

Comments
 (0)