@@ -802,6 +802,48 @@ describe("Reorganize Pages View", () => {
802802 await closePages ( pages ) ;
803803 } ) ;
804804
805+ it ( "should check that a page can be copied and pasted before the first thumbnail" , async ( ) => {
806+ await Promise . all (
807+ pages . map ( async ( [ browserName , page ] ) => {
808+ await waitForThumbnailVisible ( page , 1 ) ;
809+ await page . waitForSelector ( "#viewsManagerStatusActionButton" , {
810+ visible : true ,
811+ } ) ;
812+ await waitAndClick (
813+ page ,
814+ `.thumbnail:has(${ getThumbnailSelector ( 2 ) } ) input`
815+ ) ;
816+
817+ let handlePagesEdited = await waitForPagesEdited ( page ) ;
818+ await waitAndClick ( page , "#viewsManagerStatusActionButton" ) ;
819+ await waitAndClick ( page , "#viewsManagerStatusActionCopy" ) ;
820+
821+ let pageIndices = await awaitPromise ( handlePagesEdited ) ;
822+ let expected = [
823+ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 ,
824+ ] ;
825+ expect ( pageIndices )
826+ . withContext ( `In ${ browserName } ` )
827+ . toEqual ( expected ) ;
828+ await waitForHavingContents ( page , expected ) ;
829+
830+ handlePagesEdited = await waitForPagesEdited ( page ) ;
831+ await waitAndClick (
832+ page ,
833+ `button.thumbnailPasteButton:has(+ ${ getThumbnailSelector ( 1 ) } )`
834+ ) ;
835+ pageIndices = await awaitPromise ( handlePagesEdited ) ;
836+ expected = [
837+ 2 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 ,
838+ ] ;
839+ expect ( pageIndices )
840+ . withContext ( `In ${ browserName } ` )
841+ . toEqual ( expected ) ;
842+ await waitForHavingContents ( page , expected ) ;
843+ } )
844+ ) ;
845+ } ) ;
846+
805847 it ( "should check that the pages has been copied and pasted correctly" , async ( ) => {
806848 await Promise . all (
807849 pages . map ( async ( [ browserName , page ] ) => {
0 commit comments