@@ -14,6 +14,7 @@ import { LibraryProvider } from '@src/library-authoring/common/context/LibraryCo
1414import { mockContentLibrary , mockGetMigrationInfo } from '@src/library-authoring/data/api.mocks' ;
1515import { useGetBlockTypes } from '@src/search-manager' ;
1616import { bulkModulestoreMigrateUrl } from '@src/data/api' ;
17+ import { useLibraryBlockLimits } from '@src/library-authoring/data/apiHooks' ;
1718import { ImportStepperPage } from './ImportStepperPage' ;
1819
1920let 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+
4046const 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