@@ -6,11 +6,9 @@ test('Insert selects the current file', async ({page}) => {
66 await page . goto ( '/' ) ;
77
88 const rows = getRows ( page ) ;
9- const dotdot = rows . nth ( 0 ) ;
10-
11- await expect ( dotdot ) . toHaveClass ( / c u r r e n t - f i l e / ) ;
9+ const first = rows . nth ( 0 ) ;
1210
13- const first = rows . nth ( 1 ) ;
11+ await expect ( first ) . toHaveClass ( / c u r r e n t - f i l e / ) ;
1412
1513 await first . click ( ) ;
1614 await page . keyboard . press ( 'Insert' ) ;
@@ -33,7 +31,7 @@ test('Insert moves the cursor to the next file', async ({page}) => {
3331 await expect ( second ) . toHaveClass ( / c u r r e n t - f i l e / ) ;
3432} ) ;
3533
36- test ( 'Insert does not leave the cursor on the last file' , async ( { page} ) => {
34+ test ( 'Insert does not leave the cursor on the first file' , async ( { page} ) => {
3735 await page . goto ( '/' ) ;
3836
3937 const rows = getRows ( page ) ;
@@ -51,12 +49,14 @@ test('pressing Insert twice selects two consecutive files: first selected', asyn
5149 await page . goto ( '/' ) ;
5250
5351 const rows = getRows ( page ) ;
54- const first = rows . nth ( 1 ) ;
55- const second = rows . nth ( 2 ) ;
52+ const first = rows . nth ( 0 ) ;
53+ const second = rows . nth ( 1 ) ;
5654
5755 await first . click ( ) ;
5856 await page . keyboard . press ( 'Insert' ) ;
57+
5958 await expect ( second ) . toHaveClass ( / c u r r e n t - f i l e / ) ;
59+
6060 await page . keyboard . press ( 'Insert' ) ;
6161
6262 await expect ( first ) . toHaveClass ( / s e l e c t e d - f i l e / ) ;
@@ -71,23 +71,28 @@ test('pressing Insert twice selects two consecutive files: second selected', asy
7171
7272 await first . click ( ) ;
7373 await page . keyboard . press ( 'Insert' ) ;
74+
75+ await expect ( second ) . toHaveClass ( / c u r r e n t - f i l e / ) ;
76+
7477 await page . keyboard . press ( 'Insert' ) ;
7578
7679 await expect ( second ) . toHaveClass ( / s e l e c t e d - f i l e / ) ;
7780} ) ;
7881
79- test ( 'pressing Insert twice leaves cursor on the second file' , async ( { page} ) => {
82+ test ( 'pressing Insert twice leaves cursor on the third file' , async ( { page} ) => {
8083 await page . goto ( '/' ) ;
8184
8285 const rows = getRows ( page ) ;
86+ const first = rows . nth ( 0 ) ;
8387 const second = rows . nth ( 1 ) ;
88+ const third = rows . nth ( 2 ) ;
8489
85- await rows
86- . nth ( 1 )
87- . click ( ) ;
88-
89- await page . keyboard . press ( 'Insert' ) ;
90+ await first . click ( ) ;
9091 await page . keyboard . press ( 'Insert' ) ;
9192
9293 await expect ( second ) . toHaveClass ( / c u r r e n t - f i l e / ) ;
94+
95+ await page . keyboard . press ( 'Insert' ) ;
96+
97+ await expect ( third ) . toHaveClass ( / c u r r e n t - f i l e / ) ;
9398} ) ;
0 commit comments