@@ -58,6 +58,31 @@ describe('Files: Sorting the file list', { testIsolation: true }, () => {
5858 } )
5959 } )
6060
61+ /**
62+ * Regression test of https://github.com/nextcloud/server/issues/45829
63+ */
64+ it ( 'Filesnames with numbers are sorted by name ascending by default' , ( ) => {
65+ cy . uploadContent ( currentUser , new Blob ( ) , 'text/plain' , '/name.txt' )
66+ . uploadContent ( currentUser , new Blob ( ) , 'text/plain' , '/name_03.txt' )
67+ . uploadContent ( currentUser , new Blob ( ) , 'text/plain' , '/name_02.txt' )
68+ . uploadContent ( currentUser , new Blob ( ) , 'text/plain' , '/name_01.txt' )
69+ cy . login ( currentUser )
70+ cy . visit ( '/apps/files' )
71+
72+ cy . get ( '[data-cy-files-list-row]' ) . each ( ( $row , index ) => {
73+ switch ( index ) {
74+ case 0 : expect ( $row . attr ( 'data-cy-files-list-row-name' ) ) . to . eq ( 'name.txt' )
75+ break
76+ case 1 : expect ( $row . attr ( 'data-cy-files-list-row-name' ) ) . to . eq ( 'name_01.txt' )
77+ break
78+ case 2 : expect ( $row . attr ( 'data-cy-files-list-row-name' ) ) . to . eq ( 'name_02.txt' )
79+ break
80+ case 3 : expect ( $row . attr ( 'data-cy-files-list-row-name' ) ) . to . eq ( 'name_03.txt' )
81+ break
82+ }
83+ } )
84+ } )
85+
6186 it ( 'Can sort by size' , ( ) => {
6287 cy . uploadContent ( currentUser , new Blob ( ) , 'text/plain' , '/1 tiny.txt' )
6388 . uploadContent ( currentUser , new Blob ( [ 'a' . repeat ( 1024 ) ] ) , 'text/plain' , '/z big.txt' )
0 commit comments