@@ -20,13 +20,15 @@ import {
2020 createPromise ,
2121 createPromiseWithArgs ,
2222 dragAndDrop ,
23+ FSI ,
2324 getAnnotationSelector ,
2425 getRect ,
2526 getThumbnailSelector ,
2627 kbCopy ,
2728 kbCut ,
2829 kbDelete ,
2930 loadAndWait ,
31+ PDI ,
3032 scrollIntoView ,
3133 showViewsManager ,
3234 waitAndClick ,
@@ -792,6 +794,42 @@ describe("Reorganize Pages View", () => {
792794 await closePages ( pages ) ;
793795 } ) ;
794796
797+ it ( "should check that the paste button spans have the right l10n id depending on their position" , async ( ) => {
798+ await Promise . all (
799+ pages . map ( async ( [ browserName , page ] ) => {
800+ await waitForThumbnailVisible ( page , 1 ) ;
801+ await page . waitForSelector ( "#viewsManagerStatusActionButton" , {
802+ visible : true ,
803+ } ) ;
804+ await waitAndClick (
805+ page ,
806+ `.thumbnail:has(${ getThumbnailSelector ( 1 ) } ) input`
807+ ) ;
808+
809+ const handlePagesEdited = await waitForPagesEdited ( page ) ;
810+ await waitAndClick ( page , "#viewsManagerStatusActionButton" ) ;
811+ await waitAndClick ( page , "#viewsManagerStatusActionCopy" ) ;
812+ await awaitPromise ( handlePagesEdited ) ;
813+
814+ const prevSpanText = await page . $eval (
815+ `button.thumbnailPasteButton:has(+ ${ getThumbnailSelector ( 1 ) } ) > span` ,
816+ el => el . textContent . trim ( )
817+ ) ;
818+ expect ( prevSpanText )
819+ . withContext ( `In ${ browserName } ` )
820+ . toBe ( "Paste before the first page" ) ;
821+
822+ const afterSpanText = await page . $eval (
823+ `${ getThumbnailSelector ( 1 ) } + button.thumbnailPasteButton > span` ,
824+ el => el . textContent . trim ( )
825+ ) ;
826+ expect ( afterSpanText )
827+ . withContext ( `In ${ browserName } ` )
828+ . toBe ( `Paste after page ${ FSI } 1${ PDI } ` ) ;
829+ } )
830+ ) ;
831+ } ) ;
832+
795833 it ( "should check that a page can be copied and pasted before the first thumbnail" , async ( ) => {
796834 await Promise . all (
797835 pages . map ( async ( [ browserName , page ] ) => {
0 commit comments