@@ -683,21 +683,35 @@ export const updateDescriptionForChildren = async (
683683 const modalEditor = modal . locator ( descriptionBox ) ;
684684 await expect ( modalEditor ) . toBeVisible ( ) ;
685685 await modalEditor . click ( ) ;
686- await modalEditor . clear ( ) ;
687- await modalEditor . fill ( description ) ;
688686
689- // REMOVED: toHaveText check - rich text editor may have formatting that makes exact match unreliable
690- // The final verification after save is sufficient
687+ // Playwright's clear() and fill('') can be unreliable with ProseMirror's internal state.
688+ // Instead, select all text and delete it using keyboard events to ensure ProseMirror
689+ // accurately detects and processes the changes.
690+ await page . keyboard . press ( 'ControlOrMeta+A' ) ;
691+ await page . keyboard . press ( 'Backspace' ) ;
691692
692- // Wait for API response
693+ if ( description ) {
694+ await modalEditor . fill ( description ) ;
695+ }
696+
697+ // Wait for API response — use a function predicate so we only match the
698+ // write request (PUT/PATCH) and never accidentally resolve on a concurrent
693699 let updateRequest ;
694700 if (
695701 entityEndpoint === 'tables' ||
696702 entityEndpoint === 'dashboard/datamodels'
697703 ) {
698- updateRequest = page . waitForResponse ( '/api/v1/columns/name/*' ) ;
704+ updateRequest = page . waitForResponse (
705+ ( response ) =>
706+ response . url ( ) . includes ( '/api/v1/columns/name/' ) &&
707+ [ 'PUT' , 'PATCH' ] . includes ( response . request ( ) . method ( ) )
708+ ) ;
699709 } else {
700- updateRequest = page . waitForResponse ( `/api/v1/${ entityEndpoint } /*` ) ;
710+ updateRequest = page . waitForResponse (
711+ ( response ) =>
712+ response . url ( ) . includes ( `/api/v1/${ entityEndpoint } /` ) &&
713+ [ 'PUT' , 'PATCH' ] . includes ( response . request ( ) . method ( ) )
714+ ) ;
701715 }
702716
703717 const saveButton = page . getByTestId ( 'save' ) ;
@@ -717,10 +731,12 @@ export const updateDescriptionForChildren = async (
717731 } ) ;
718732
719733 // Verify the description was updated in the UI
734+ // Use a generous timeout: parallel runs under CPU load can delay row re-renders
735+ // beyond Playwright's default 5 s, causing false failures on the remove step.
720736 if ( isEmpty ( description ) ) {
721737 await expect (
722738 page . locator ( `[${ rowSelector } ="${ rowId } "]` ) . getByTestId ( 'description' )
723- ) . toContainText ( 'No Description' ) ;
739+ ) . toContainText ( 'No Description' , { timeout : 10000 } ) ;
724740 } else {
725741 await expect (
726742 page
0 commit comments