@@ -16,10 +16,6 @@ import fetchMock from 'fetch-mock-jest';
1616import type { Store } from 'redux' ;
1717
1818import initializeStore from '../store' ;
19- import { executeThunk } from '../utils' ;
20- import { getStudioHomeApiUrl } from '../studio-home/data/api' ;
21- import { fetchStudioHomeData } from '../studio-home/data/thunks' ;
22- import { generateGetStudioHomeDataApiResponse } from '../studio-home/factories/mockApiResponses' ;
2319import mockResult from './__mocks__/search-result.json' ;
2420import mockEmptyResult from './__mocks__/empty-search-result.json' ;
2521import mockTagsFacetResult from './__mocks__/facet-search.json' ;
@@ -316,43 +312,7 @@ describe('<SearchUI />', () => {
316312 ) ;
317313 } ) ;
318314
319- test ( 'click lib component result navigates to the context' , async ( ) => {
320- const data = generateGetStudioHomeDataApiResponse ( ) ;
321- data . redirectToLibraryAuthoringMfe = true ;
322- axiosMock . onGet ( getStudioHomeApiUrl ( ) ) . reply ( 200 , data ) ;
323-
324- await executeThunk ( fetchStudioHomeData ( ) , store . dispatch ) ;
325-
326- const { findByRole } = rendered ;
327-
328- const resultItem = await findByRole ( 'button' , { name : / L i b r a r y C o n t e n t / } ) ;
329-
330- // Clicking the "Open in new window" button should open the result in a new window:
331- const { open, location } = window ;
332- window . open = jest . fn ( ) ;
333- fireEvent . click ( within ( resultItem ) . getByRole ( 'button' , { name : 'Open in new window' } ) ) ;
334- expect ( window . open ) . toHaveBeenCalledWith (
335- 'http://localhost:3001/library/lib:org1:libafter1' ,
336- '_blank' ,
337- ) ;
338- window . open = open ;
339-
340- // @ts -ignore
341- window . location = { href : '' } ;
342- // Clicking in the result should navigate to the result's URL:
343- fireEvent . click ( resultItem ) ;
344- expect ( window . location . href = 'http://localhost:3001/library/lib:org1:libafter1' ) ;
345- window . location = location ;
346- } ) ;
347-
348- test ( 'click lib component result navigates to course-authoring/library without libraryAuthoringMfe' , async ( ) => {
349- const data = generateGetStudioHomeDataApiResponse ( ) ;
350- data . redirectToLibraryAuthoringMfe = false ;
351- data . libraryAuthoringMfeUrl = '' ;
352- axiosMock . onGet ( getStudioHomeApiUrl ( ) ) . reply ( 200 , data ) ;
353-
354- await executeThunk ( fetchStudioHomeData ( ) , store . dispatch ) ;
355-
315+ test ( 'click lib component result navigates to course-authoring/library' , async ( ) => {
356316 const { findByRole } = rendered ;
357317
358318 const resultItem = await findByRole ( 'button' , { name : / L i b r a r y C o n t e n t / } ) ;
0 commit comments