@@ -118,6 +118,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
118118
119119 beforeEach ( ( ) => {
120120 mockUseSidebarMetadataFetcher . mockReturnValue ( {
121+ clearExtractError : jest . fn ( ) ,
121122 extractSuggestions : jest . fn ( ) ,
122123 handleCreateMetadataInstance : jest . fn ( ) ,
123124 handleDeleteMetadataInstance : jest . fn ( ) ,
@@ -127,6 +128,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
127128 errorMessage : null ,
128129 status : STATUS . SUCCESS ,
129130 file : mockFile ,
131+ extractErrorCode : null ,
130132 } ) ;
131133 } ) ;
132134
@@ -142,6 +144,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
142144
143145 test ( 'should have accessible "All templates" combobox trigger button' , ( ) => {
144146 mockUseSidebarMetadataFetcher . mockReturnValue ( {
147+ clearExtractError : jest . fn ( ) ,
145148 extractSuggestions : jest . fn ( ) ,
146149 handleCreateMetadataInstance : jest . fn ( ) ,
147150 handleDeleteMetadataInstance : jest . fn ( ) ,
@@ -151,6 +154,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
151154 errorMessage : null ,
152155 status : STATUS . SUCCESS ,
153156 file : mockFile ,
157+ extractErrorCode : null ,
154158 } ) ;
155159
156160 renderComponent ( ) ;
@@ -184,6 +188,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
184188
185189 test ( 'should have accessible "All templates" combobox trigger button' , ( ) => {
186190 mockUseSidebarMetadataFetcher . mockReturnValue ( {
191+ clearExtractError : jest . fn ( ) ,
187192 extractSuggestions : jest . fn ( ) ,
188193 handleCreateMetadataInstance : jest . fn ( ) ,
189194 handleDeleteMetadataInstance : jest . fn ( ) ,
@@ -193,6 +198,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
193198 errorMessage : null ,
194199 status : STATUS . SUCCESS ,
195200 file : mockFile ,
201+ extractErrorCode : null ,
196202 } ) ;
197203
198204 renderComponent ( ) ;
@@ -204,6 +210,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
204210
205211 test ( 'should render metadata sidebar with error' , async ( ) => {
206212 mockUseSidebarMetadataFetcher . mockReturnValue ( {
213+ clearExtractError : jest . fn ( ) ,
207214 extractSuggestions : jest . fn ( ) ,
208215 handleCreateMetadataInstance : jest . fn ( ) ,
209216 handleDeleteMetadataInstance : jest . fn ( ) ,
@@ -216,6 +223,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
216223 } ,
217224 status : STATUS . ERROR ,
218225 file : mockFile ,
226+ extractErrorCode : null ,
219227 } ) ;
220228
221229 const errorMessage = { id : 'error' , defaultMessage : 'error message' } ;
@@ -227,6 +235,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
227235
228236 test ( 'should render metadata sidebar with loading indicator' , async ( ) => {
229237 mockUseSidebarMetadataFetcher . mockReturnValue ( {
238+ clearExtractError : jest . fn ( ) ,
230239 extractSuggestions : jest . fn ( ) ,
231240 handleCreateMetadataInstance : jest . fn ( ) ,
232241 handleDeleteMetadataInstance : jest . fn ( ) ,
@@ -236,6 +245,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
236245 errorMessage : null ,
237246 status : STATUS . LOADING ,
238247 file : mockFile ,
248+ extractErrorCode : null ,
239249 } ) ;
240250
241251 renderComponent ( ) ;
@@ -266,6 +276,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
266276
267277 test ( 'should render empty state when no visible template instances are present' , ( ) => {
268278 mockUseSidebarMetadataFetcher . mockReturnValue ( {
279+ clearExtractError : jest . fn ( ) ,
269280 extractSuggestions : jest . fn ( ) ,
270281 handleCreateMetadataInstance : jest . fn ( ) ,
271282 handleDeleteMetadataInstance : jest . fn ( ) ,
@@ -275,6 +286,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
275286 errorMessage : null ,
276287 status : STATUS . SUCCESS ,
277288 file : mockFile ,
289+ extractErrorCode : null ,
278290 } ) ;
279291
280292 renderComponent ( ) ;
@@ -288,6 +300,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
288300
289301 test ( 'should render metadata instance list when templates are present' , ( ) => {
290302 mockUseSidebarMetadataFetcher . mockReturnValue ( {
303+ clearExtractError : jest . fn ( ) ,
291304 extractSuggestions : jest . fn ( ) ,
292305 handleCreateMetadataInstance : jest . fn ( ) ,
293306 handleDeleteMetadataInstance : jest . fn ( ) ,
@@ -297,6 +310,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
297310 errorMessage : null ,
298311 status : STATUS . SUCCESS ,
299312 file : mockFile ,
313+ extractErrorCode : null ,
300314 } ) ;
301315
302316 renderComponent ( ) ;
@@ -311,6 +325,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
311325
312326 test ( 'should render filter dropdown when more than one templates are present' , ( ) => {
313327 mockUseSidebarMetadataFetcher . mockReturnValue ( {
328+ clearExtractError : jest . fn ( ) ,
314329 extractSuggestions : jest . fn ( ) ,
315330 handleCreateMetadataInstance : jest . fn ( ) ,
316331 handleDeleteMetadataInstance : jest . fn ( ) ,
@@ -320,6 +335,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
320335 errorMessage : null ,
321336 status : STATUS . SUCCESS ,
322337 file : mockFile ,
338+ extractErrorCode : null ,
323339 } ) ;
324340
325341 renderComponent ( ) ;
@@ -337,6 +353,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
337353 'should not render filter dropdown when only one or none visible template is present' ,
338354 ( templateInstances : MetadataTemplateInstance [ ] ) => {
339355 mockUseSidebarMetadataFetcher . mockReturnValue ( {
356+ clearExtractError : jest . fn ( ) ,
340357 extractSuggestions : jest . fn ( ) ,
341358 handleCreateMetadataInstance : jest . fn ( ) ,
342359 handleDeleteMetadataInstance : jest . fn ( ) ,
@@ -346,6 +363,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
346363 errorMessage : null ,
347364 status : STATUS . SUCCESS ,
348365 file : mockFile ,
366+ extractErrorCode : null ,
349367 } ) ;
350368
351369 renderComponent ( ) ;
@@ -356,6 +374,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
356374
357375 test ( 'should render metadata filterd instance list when fileterd templates are present and matching' , ( ) => {
358376 mockUseSidebarMetadataFetcher . mockReturnValue ( {
377+ clearExtractError : jest . fn ( ) ,
359378 extractSuggestions : jest . fn ( ) ,
360379 handleCreateMetadataInstance : jest . fn ( ) ,
361380 handleDeleteMetadataInstance : jest . fn ( ) ,
@@ -365,6 +384,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
365384 errorMessage : null ,
366385 status : STATUS . SUCCESS ,
367386 file : mockFile ,
387+ extractErrorCode : null ,
368388 } ) ;
369389
370390 const filteredTemplateIds = [ mockVisibleTemplateInstance . id ] ;
@@ -378,6 +398,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
378398
379399 test ( 'should render metadata unfiltered instance list when fileterd templates are present and do not match existing templates' , ( ) => {
380400 mockUseSidebarMetadataFetcher . mockReturnValue ( {
401+ clearExtractError : jest . fn ( ) ,
381402 extractSuggestions : jest . fn ( ) ,
382403 handleCreateMetadataInstance : jest . fn ( ) ,
383404 handleDeleteMetadataInstance : jest . fn ( ) ,
@@ -387,6 +408,7 @@ describe('elements/content-sidebar/Metadata/MetadataSidebarRedesign', () => {
387408 errorMessage : null ,
388409 status : STATUS . SUCCESS ,
389410 file : mockFile ,
411+ extractErrorCode : null ,
390412 } ) ;
391413
392414 const filteredTemplateIds = [ 'non-existing-template-id' ] ;
0 commit comments