@@ -212,7 +212,6 @@ describe('ManagedResources - Edit Resource', () => {
212212 const fakeUseHandleResourcePatch : typeof useHandleResourcePatch = ( ) => {
213213 patchHandlerCreated = true ;
214214 return async ( item : any ) => {
215- cy . log ( 'Patch handler called!' ) ;
216215 patchCalled = true ;
217216 patchedItem = item ;
218217 return true ;
@@ -271,11 +270,15 @@ describe('ManagedResources - Edit Resource', () => {
271270 ] ;
272271
273272 before ( ( ) => {
274- // Ignore Monaco Editor disposal errors
275273 cy . on ( 'uncaught:exception' , ( err ) => {
274+ // Ignore Monaco Editor errors
276275 if ( err . message . includes ( 'TextModel got disposed' ) ) {
277276 return false ;
278277 }
278+ // Ignore DiffEditorWidget errors
279+ if ( err . message . includes ( 'DiffEditorWidget' ) ) {
280+ return false ;
281+ }
279282 return true ;
280283 } ) ;
281284 } ) ;
@@ -314,31 +317,23 @@ describe('ManagedResources - Edit Resource', () => {
314317
315318 // Verify YAML panel opened
316319 cy . contains ( 'YAML' ) . should ( 'be.visible' ) ;
317- cy . contains ( 'test-subaccount' ) . should ( 'be.visible' ) ;
318320
319321 // Verify patch not called yet
320- cy . then ( ( ) => {
321- cy . log ( `patchCalled before Apply: ${ patchCalled } ` ) ;
322- cy . wrap ( patchCalled ) . should ( 'equal' , false ) ;
323- } ) ;
322+ cy . then ( ( ) => cy . wrap ( patchCalled ) . should ( 'equal' , false ) ) ;
324323
325324 // Click Apply button
326- cy . contains ( 'Apply changes ') . click ( ) ;
325+ cy . get ( '[data-testid="yaml-apply-button"]' ) . should ( 'be.visible ') . click ( ) ;
327326
328- // Wait for dialog and confirm
329- cy . get ( 'ui5-dialog' , { timeout : 10000 } ) . should ( 'exist' ) ;
330- cy . contains ( 'Yes' ) . click ( { force : true } ) ;
327+ // Confirm in dialog
328+ cy . get ( '[data-testid="yaml-confirm-button"]' , { timeout : 10000 } ) . should ( 'be.visible' ) . click ( { force : true } ) ;
331329
332- // Give it time to process
333- cy . wait ( 2000 ) ;
330+ // Wait for success message
331+ cy . contains ( 'Update submitted' , { timeout : 10000 } ) . should ( 'be.visible' ) ;
334332
335333 // Verify patch was called
336334 cy . then ( ( ) => {
337- cy . log ( ` patchCalled after Apply: ${ patchCalled } ` ) ;
338- cy . log ( ` patchedItem: ${ JSON . stringify ( patchedItem ) } ` ) ;
335+ expect ( patchCalled ) . to . equal ( true ) ;
336+ expect ( patchedItem ) . to . not . be . null ;
339337 } ) ;
340-
341- cy . then ( ( ) => cy . wrap ( patchCalled ) . should ( 'equal' , true ) ) ;
342- cy . then ( ( ) => cy . wrap ( patchedItem ) . should ( 'not.be.null' ) ) ;
343338 } ) ;
344- } ) ;
339+ } ) ;
0 commit comments