@@ -26,6 +26,9 @@ jest.spyOn(editorCmsApi, 'fetchByUnitId').mockImplementation(async () => ({
26
26
} ] ,
27
27
} ,
28
28
} ) ) ;
29
+ jest . mock ( '../library-authoring/LibraryBlock' , ( ) => ( {
30
+ LibraryBlock : jest . fn ( ( ) => ( < div > Advanced Editor Iframe</ div > ) ) ,
31
+ } ) ) ;
29
32
30
33
const defaultPropsHtml = {
31
34
blockId : 'block-v1:Org+TS100+24+type@html+block@123456html' ,
@@ -79,9 +82,7 @@ describe('EditorPage', () => {
79
82
expect ( modalElement . classList ) . not . toContain ( 'pgn__modal-xl' ) ;
80
83
} ) ;
81
84
82
- test ( 'it shows an error message if there is no corresponding editor' , async ( ) => {
83
- // We can edit 'html', 'problem', and 'video' blocks.
84
- // But if we try to edit some other type, say 'fake', we should get an error:
85
+ test ( 'it shows the Advanced Editor if there is no corresponding editor' , async ( ) => {
85
86
jest . spyOn ( editorCmsApi , 'fetchBlockById' ) . mockImplementationOnce ( async ( ) => ( // eslint-disable-next-line
86
87
{ status : 200 , data : { display_name : 'Fake Un-editable Block' , category : 'fake' , metadata : { } , data : '' } }
87
88
) ) ;
@@ -93,6 +94,6 @@ describe('EditorPage', () => {
93
94
} ;
94
95
render ( < EditorPage { ...defaultPropsFake } /> ) ;
95
96
96
- expect ( await screen . findByText ( 'Error: Could Not find Editor' ) ) . toBeInTheDocument ( ) ;
97
+ expect ( await screen . findByText ( 'Advanced Editor Iframe ' ) ) . toBeInTheDocument ( ) ;
97
98
} ) ;
98
99
} ) ;
0 commit comments