@@ -18,53 +18,66 @@ test('Insert moves the cursor to the next file', async ({page}) => {
1818 await page . goto ( '/' ) ;
1919
2020 const rows = getRows ( page ) ;
21- const first = rows . nth ( 1 ) ;
22- const second = rows . nth ( 2 ) ;
21+ const first = rows . nth ( 0 ) ;
22+ const second = rows . nth ( 1 ) ;
2323
2424 await first . click ( ) ;
2525 await page . keyboard . press ( 'Insert' ) ;
2626
2727 await expect ( second ) . toHaveClass ( / c u r r e n t - f i l e / ) ;
2828} ) ;
2929
30- test ( 'Insert does not leave the cursor on the first file' , async ( { page} ) => {
30+ test ( 'Insert does not leave the cursor on the last file' , async ( { page} ) => {
3131 await page . goto ( '/' ) ;
3232
3333 const rows = getRows ( page ) ;
34- const first = rows . nth ( 1 ) ;
34+ const first = rows . nth ( 0 ) ;
3535
3636 await first . click ( ) ;
3737 await page . keyboard . press ( 'Insert' ) ;
3838
3939 await expect ( first ) . not . toHaveClass ( / c u r r e n t - f i l e / ) ;
4040} ) ;
4141
42- test ( 'pressing Insert twice selects two consecutive files' , async ( { page} ) => {
42+ test ( 'pressing Insert twice selects two consecutive files: first selected ' , async ( { page} ) => {
4343 await page . goto ( '/' ) ;
4444
4545 const rows = getRows ( page ) ;
46- const first = rows . nth ( 1 ) ;
47- const second = rows . nth ( 2 ) ;
46+ const first = rows . nth ( 0 ) ;
4847
4948 await first . click ( ) ;
5049 await page . keyboard . press ( 'Insert' ) ;
5150 await page . keyboard . press ( 'Insert' ) ;
5251
5352 await expect ( first ) . toHaveClass ( / s e l e c t e d - f i l e / ) ;
53+ } ) ;
54+
55+ test ( 'pressing Insert twice selects two consecutive files: second selected' , async ( { page} ) => {
56+ await page . goto ( '/' ) ;
57+
58+ const rows = getRows ( page ) ;
59+ const first = rows . nth ( 0 ) ;
60+ const second = rows . nth ( 1 ) ;
61+
62+ await first . click ( ) ;
63+ await page . keyboard . press ( 'Insert' ) ;
64+ await page . keyboard . press ( 'Insert' ) ;
65+
5466 await expect ( second ) . toHaveClass ( / s e l e c t e d - f i l e / ) ;
5567} ) ;
5668
57- test ( 'pressing Insert twice leaves cursor on the third file' , async ( { page} ) => {
69+ test ( 'pressing Insert twice leaves cursor on the second file' , async ( { page} ) => {
5870 await page . goto ( '/' ) ;
5971
6072 const rows = getRows ( page ) ;
61- const third = rows . nth ( 3 ) ;
73+ const second = rows . nth ( 1 ) ;
6274
6375 await rows
6476 . nth ( 1 )
6577 . click ( ) ;
78+
6679 await page . keyboard . press ( 'Insert' ) ;
6780 await page . keyboard . press ( 'Insert' ) ;
6881
69- await expect ( third ) . toHaveClass ( / c u r r e n t - f i l e / ) ;
82+ await expect ( second ) . toHaveClass ( / c u r r e n t - f i l e / ) ;
7083} ) ;
0 commit comments