@@ -32,7 +32,7 @@ const exampleNodes = [
32
32
root : '/' ,
33
33
size : 321 ,
34
34
attributes : {
35
- favorite : true ,
35
+ favorite : 1 ,
36
36
} ,
37
37
} ) ,
38
38
new Folder ( {
@@ -157,10 +157,10 @@ describe('FilePicker FileList', () => {
157
157
const rows = wrapper . findAll ( '[data-testid="file-list-row"]' )
158
158
// all nodes are shown
159
159
expect ( rows . length ) . toBe ( nodes . length )
160
- // folder are sorted first
161
- expect ( rows . at ( 0 ) . attributes ( 'data-filename' ) ) . toBe ( 'directory' )
162
160
// by default favorites are sorted before other files
163
- expect ( rows . at ( 1 ) . attributes ( 'data-filename' ) ) . toBe ( 'favorite.txt' )
161
+ expect ( rows . at ( 0 ) . attributes ( 'data-filename' ) ) . toBe ( 'favorite.txt' )
162
+ // folder are sorted first
163
+ expect ( rows . at ( 1 ) . attributes ( 'data-filename' ) ) . toBe ( 'directory' )
164
164
// other files are ascending
165
165
expect ( rows . at ( 2 ) . attributes ( 'data-filename' ) ) . toBe ( 'a-file.txt' )
166
166
expect ( rows . at ( 3 ) . attributes ( 'data-filename' ) ) . toBe ( 'b-file.txt' )
@@ -192,10 +192,10 @@ describe('FilePicker FileList', () => {
192
192
const rows = wrapper . findAll ( '.file-picker__row' )
193
193
// all nodes are shown
194
194
expect ( rows . length ) . toBe ( nodes . length )
195
- // folder are sorted first
196
- expect ( rows . at ( 0 ) . attributes ( 'data-filename' ) ) . toBe ( 'directory' )
197
195
// by default favorites are sorted before other files
198
- expect ( rows . at ( 1 ) . attributes ( 'data-filename' ) ) . toBe ( 'favorite.txt' )
196
+ expect ( rows . at ( 0 ) . attributes ( 'data-filename' ) ) . toBe ( 'favorite.txt' )
197
+ // folder are sorted first
198
+ expect ( rows . at ( 1 ) . attributes ( 'data-filename' ) ) . toBe ( 'directory' )
199
199
// other files are descending
200
200
expect ( rows . at ( 2 ) . attributes ( 'data-filename' ) ) . toBe ( 'b-file.txt' )
201
201
expect ( rows . at ( 3 ) . attributes ( 'data-filename' ) ) . toBe ( 'a-file.txt' )
0 commit comments