@@ -24,6 +24,8 @@ import {
2424 highlightSpan ,
2525 kbModifierDown ,
2626 kbModifierUp ,
27+ kbRedo ,
28+ kbUndo ,
2729 loadAndWait ,
2830 scrollIntoView ,
2931 selectEditor ,
@@ -1137,5 +1139,43 @@ describe("Comment", () => {
11371139 } )
11381140 ) ;
11391141 } ) ;
1142+
1143+ it ( "must check that the comment popup is hidden after redo" , async ( ) => {
1144+ await Promise . all (
1145+ pages . map ( async ( [ browserName , page ] ) => {
1146+ await switchToHighlight ( page ) ;
1147+ await highlightSpan ( page , 1 , "Abstract" ) ;
1148+ const editorSelector = getEditorSelector ( 0 ) ;
1149+ const comment = "Test comment for redo" ;
1150+ await editComment ( page , editorSelector , comment ) ;
1151+
1152+ // Show the popup by clicking the comment button
1153+ await waitAndClick (
1154+ page ,
1155+ `${ editorSelector } .annotationCommentButton`
1156+ ) ;
1157+ await page . waitForSelector ( "#commentPopup" , { visible : true } ) ;
1158+
1159+ // Delete the comment
1160+ await waitAndClick ( page , "button.commentPopupDelete" ) ;
1161+ await page . waitForSelector ( "#editorUndoBar" , { visible : true } ) ;
1162+
1163+ // Undo the deletion
1164+ await kbUndo ( page ) ;
1165+ await page . waitForSelector ( "#editorUndoBar" , { hidden : true } ) ;
1166+
1167+ // Show the popup again by clicking the comment button
1168+ await waitAndClick (
1169+ page ,
1170+ `${ editorSelector } .annotationCommentButton`
1171+ ) ;
1172+ await page . waitForSelector ( "#commentPopup" , { visible : true } ) ;
1173+
1174+ // Redo the deletion - popup should be hidden
1175+ await kbRedo ( page ) ;
1176+ await page . waitForSelector ( "#commentPopup" , { hidden : true } ) ;
1177+ } )
1178+ ) ;
1179+ } ) ;
11401180 } ) ;
11411181} ) ;
0 commit comments