@@ -15,7 +15,6 @@ import { initializeVideoPressAjaxBridge } from './videopress-bridge.js';
1515import { configureLocale } from './localization.js' ;
1616import { initializeApiFetch } from './api-fetch.js' ;
1717import { initializeEditor } from './editor.jsx' ;
18- import { unregisterDisallowedBlocks } from './blocks.js' ;
1918
2019vi . mock ( './bridge.js' ) ;
2120vi . mock ( './logger.js' ) ;
@@ -43,10 +42,6 @@ vi.mock( './editor.jsx', () => ( {
4342 initializeEditor : vi . fn ( ) ,
4443} ) ) ;
4544
46- vi . mock ( './blocks.js' , ( ) => ( {
47- unregisterDisallowedBlocks : vi . fn ( ) ,
48- } ) ) ;
49-
5045describe ( 'setUpEditorEnvironment' , ( ) => {
5146 beforeEach ( ( ) => {
5247 vi . clearAllMocks ( ) ;
@@ -105,7 +100,7 @@ describe( 'setUpEditorEnvironment', () => {
105100 ] ) ;
106101 } ) ;
107102
108- it ( 'loads plugins and unregisters disallowed blocks when plugins enabled' , async ( ) => {
103+ it ( 'loads plugins when plugins enabled' , async ( ) => {
109104 getGBKit . mockReturnValue ( { plugins : true } ) ;
110105
111106 const allowedTypes = [ 'core/paragraph' , 'core/heading' , 'core/image' ] ;
@@ -116,9 +111,6 @@ describe( 'setUpEditorEnvironment', () => {
116111 await setUpEditorEnvironment ( ) ;
117112
118113 expect ( loadEditorAssets ) . toHaveBeenCalledTimes ( 1 ) ;
119- expect ( unregisterDisallowedBlocks ) . toHaveBeenCalledWith (
120- allowedTypes
121- ) ;
122114 } ) ;
123115
124116 it ( 'skips plugin loading when plugins configuration is disabled' , async ( ) => {
@@ -127,7 +119,6 @@ describe( 'setUpEditorEnvironment', () => {
127119 await setUpEditorEnvironment ( ) ;
128120
129121 expect ( loadEditorAssets ) . not . toHaveBeenCalled ( ) ;
130- expect ( unregisterDisallowedBlocks ) . not . toHaveBeenCalled ( ) ;
131122 } ) ;
132123
133124 it ( 'skips plugin loading when plugins configuration is undefined' , async ( ) => {
@@ -136,7 +127,6 @@ describe( 'setUpEditorEnvironment', () => {
136127 await setUpEditorEnvironment ( ) ;
137128
138129 expect ( loadEditorAssets ) . not . toHaveBeenCalled ( ) ;
139- expect ( unregisterDisallowedBlocks ) . not . toHaveBeenCalled ( ) ;
140130 } ) ;
141131
142132 it ( 'handles errors during initialization' , async ( ) => {
@@ -188,7 +178,9 @@ describe( 'setUpEditorEnvironment', () => {
188178 getGBKit . mockReturnValue ( { plugins : true } ) ;
189179
190180 const testError = new Error ( 'Plugin loading failed' ) ;
191- loadEditorAssets . mockRejectedValue ( testError ) ;
181+ initializeEditor . mockImplementation ( ( ) => {
182+ throw testError ;
183+ } ) ;
192184
193185 await setUpEditorEnvironment ( ) ;
194186
0 commit comments