@@ -10,8 +10,6 @@ import messages from '../messages';
1010mockContentLibrary . applyMock ( ) ;
1111mockGetPreviewModulestoreMigration . applyMock ( ) ;
1212const { libraryId } = mockContentLibrary ;
13- const markAnalysisComplete = jest . fn ( ) ;
14- const setImportIsBlocked = jest . fn ( ) ;
1513
1614// Mock the useCourseDetails hook
1715jest . mock ( '@src/course-outline/data/apiHooks' , ( ) => ( {
@@ -45,15 +43,10 @@ describe('ReviewImportDetails', () => {
4543 } ) ;
4644
4745 it ( 'renders loading spinner when isPending is true' , async ( ) => {
48- render ( < ReviewImportDetails
49- markAnalysisComplete = { markAnalysisComplete }
50- courseId = "test-course-id"
51- setImportIsBlocked = { setImportIsBlocked }
52- /> ) ;
46+ render ( < ReviewImportDetails courseId = "test-course-id" /> ) ;
5347
5448 const spinners = await screen . findAllByRole ( 'status' ) ;
5549 spinners . every ( ( spinner ) => expect ( spinner . textContent ) . toEqual ( 'Loading...' ) ) ;
56- expect ( markAnalysisComplete ) . toHaveBeenCalledWith ( false ) ;
5750 } ) ;
5851
5952 it ( 'renders import progress status when isBlockDataPending or migrationInfoIsPending is true' , async ( ) => {
@@ -63,15 +56,10 @@ describe('ReviewImportDetails', () => {
6356 data : null ,
6457 } ) ;
6558
66- render ( < ReviewImportDetails
67- markAnalysisComplete = { markAnalysisComplete }
68- courseId = "test-course-id"
69- setImportIsBlocked = { setImportIsBlocked }
70- /> ) ;
59+ render ( < ReviewImportDetails courseId = "test-course-id" /> ) ;
7160
7261 expect ( await screen . findByRole ( 'alert' ) ) . toBeInTheDocument ( ) ;
7362 expect ( await screen . findByText ( / I m p o r t A n a l y s i s i n P r o g r e s s / i) ) . toBeInTheDocument ( ) ;
74- expect ( markAnalysisComplete ) . toHaveBeenCalledWith ( false ) ;
7563 } ) ;
7664
7765 it ( 'renders warning when reimport' , async ( ) => {
@@ -87,11 +75,7 @@ describe('ReviewImportDetails', () => {
8775 } ,
8876 } ) ;
8977
90- render ( < ReviewImportDetails
91- markAnalysisComplete = { markAnalysisComplete }
92- courseId = { courseKey }
93- setImportIsBlocked = { setImportIsBlocked }
94- /> ) ;
78+ render ( < ReviewImportDetails courseId = { courseKey } /> ) ;
9579
9680 expect ( await screen . findByRole ( 'alert' ) ) . toBeInTheDocument ( ) ;
9781 expect ( await screen . findByText ( / I m p o r t A n a l y s i s C o m p l e t e d : R e i m p o r t / i) ) . toBeInTheDocument ( ) ;
@@ -100,7 +84,6 @@ describe('ReviewImportDetails', () => {
10084 . replace ( '{courseName}' , 'Test Course' )
10185 . replace ( '{libraryName}' , 'Library title' ) ,
10286 ) ) . toBeInTheDocument ( ) ;
103- expect ( markAnalysisComplete ) . toHaveBeenCalledWith ( true ) ;
10487 } ) ;
10588
10689 it ( 'renders warning when unsupportedBlockPercentage > 0' , async ( ) => {
@@ -111,9 +94,7 @@ describe('ReviewImportDetails', () => {
11194 } ) ;
11295
11396 render ( < ReviewImportDetails
114- markAnalysisComplete = { markAnalysisComplete }
11597 courseId = { mockGetPreviewModulestoreMigration . sourceKeyUnsupported }
116- setImportIsBlocked = { setImportIsBlocked }
11798 /> ) ;
11899
119100 expect ( await screen . findByRole ( 'alert' ) ) . toBeInTheDocument ( ) ;
@@ -131,7 +112,6 @@ describe('ReviewImportDetails', () => {
131112 expect ( await screen . findByText ( '5' ) ) . toBeInTheDocument ( ) ;
132113 expect ( await screen . findByText ( 'Components' ) ) . toBeInTheDocument ( ) ;
133114 expect ( await screen . findByText ( '5/10' ) ) . toBeInTheDocument ( ) ;
134- expect ( markAnalysisComplete ) . toHaveBeenCalledWith ( true ) ;
135115 } ) ;
136116
137117 it ( 'renders warning when components exceed the limit' , async ( ) => {
@@ -142,18 +122,14 @@ describe('ReviewImportDetails', () => {
142122 } ) ;
143123
144124 render ( < ReviewImportDetails
145- markAnalysisComplete = { markAnalysisComplete }
146125 courseId = { mockGetPreviewModulestoreMigration . sourceKeyBlockLimit }
147- setImportIsBlocked = { setImportIsBlocked }
148126 /> ) ;
149127
150128 expect ( await screen . findByRole ( 'alert' ) ) . toBeInTheDocument ( ) ;
151129 expect ( await screen . findByText ( / I m p o r t B l o c k e d / i) ) . toBeInTheDocument ( ) ;
152130 expect ( await screen . findByText (
153131 / T h i s i m p o r t w o u l d e x c e e d t h e C o n t e n t L i b r a r y l i m i t o f 1 0 0 0 i t e m s / i,
154132 ) ) . toBeInTheDocument ( ) ;
155- expect ( markAnalysisComplete ) . toHaveBeenCalledWith ( true ) ;
156- expect ( setImportIsBlocked ) . toHaveBeenCalledWith ( true ) ;
157133 } ) ;
158134
159135 it ( 'renders success alert when no unsupported blocks' , async ( ) => {
@@ -164,9 +140,7 @@ describe('ReviewImportDetails', () => {
164140 } ) ;
165141
166142 render ( < ReviewImportDetails
167- markAnalysisComplete = { markAnalysisComplete }
168143 courseId = { mockGetPreviewModulestoreMigration . sourceKeyGood }
169- setImportIsBlocked = { setImportIsBlocked }
170144 /> ) ;
171145
172146 expect ( await screen . findByRole ( 'alert' ) ) . toBeInTheDocument ( ) ;
@@ -184,6 +158,5 @@ describe('ReviewImportDetails', () => {
184158 expect ( await screen . findByText ( '3' ) ) . toBeInTheDocument ( ) ;
185159 expect ( await screen . findByText ( 'Components' ) ) . toBeInTheDocument ( ) ;
186160 expect ( await screen . findByText ( '5' ) ) . toBeInTheDocument ( ) ;
187- expect ( markAnalysisComplete ) . toHaveBeenCalledWith ( true ) ;
188161 } ) ;
189162} ) ;
0 commit comments