@@ -230,15 +230,13 @@ export function moveFile(fileName: string, dirPath: string) {
230230 . findByRole ( 'button' , { name : 'All files' } )
231231 . should ( 'be.visible' )
232232 . click ( )
233- // [picker-diag] log the exact button texts to see the root label
234- cy . get ( 'button' ) . then ( ( $b ) => cy . task ( 'log' , '[picker-diag] move buttons=' + JSON . stringify ( Array . from ( $b ) . map ( ( x ) => ( x as HTMLElement ) . textContent ) ) , { log : false } ) )
235233 // Click move. Match the confirm button EXACTLY as "Move": the picker
236234 // labels it "Move to {folder}" while inside a folder and only "Move"
237235 // once it has navigated to the home root. A loose `contains('Move')`
238236 // would match the stale "Move to {folder}" button before the "All
239237 // files" navigation above has landed, moving the file into the wrong
240238 // folder. The exact match makes cypress wait for the root button.
241- cy . contains ( 'button' , / ^ \s * M o v e \s * $ / ) . should ( 'be.visible' ) . click ( )
239+ cy . contains ( 'button' , / ^ M o v e \s * $ / ) . should ( 'be.visible' ) . click ( )
242240 } else if ( dirPath === '.' ) {
243241 // click move
244242 cy . contains ( 'button' , 'Copy' ) . should ( 'be.visible' ) . click ( )
@@ -276,16 +274,14 @@ export function copyFile(fileName: string, dirPath: string) {
276274 . findByRole ( 'button' , { name : 'All files' } )
277275 . should ( 'be.visible' )
278276 . click ( )
279- // [picker-diag] log the exact button texts to see the root label
280- cy . get ( 'button' ) . then ( ( $b ) => cy . task ( 'log' , '[picker-diag] copy buttons=' + JSON . stringify ( Array . from ( $b ) . map ( ( x ) => ( x as HTMLElement ) . textContent ) ) , { log : false } ) )
281277 // Click copy. Match the confirm button EXACTLY as "Copy": the picker
282278 // labels it "Copy to {folder}" while inside a folder and only "Copy"
283279 // once it has navigated to the home root. A loose `contains('Copy')`
284280 // would match the stale "Copy to {folder}" button before the "All
285281 // files" navigation above has landed, copying the file into the wrong
286282 // folder (deduplicated as "… (1)"). The exact match makes cypress
287283 // wait for the root button.
288- cy . contains ( 'button' , / ^ \s * C o p y \s * $ / ) . should ( 'be.visible' ) . click ( )
284+ cy . contains ( 'button' , / ^ C o p y \s * $ / ) . should ( 'be.visible' ) . click ( )
289285 } else if ( dirPath === '.' ) {
290286 // click copy
291287 cy . contains ( 'button' , 'Copy' ) . should ( 'be.visible' ) . click ( )
0 commit comments