simplify sorting

This commit is contained in:
Ben Irvin 2023-07-17 15:21:29 +02:00
parent 0e451991f4
commit 2c221dc53f

View File

@ -494,13 +494,12 @@ describe('Uploads folder', () => {
}, },
}, },
populate: '*', populate: '*',
// sort the same as fileInfo so that the loop below matches regardless of order
sort: ['name:desc'],
}, },
}); });
// sort the same as fileInfo so that the loop below matches regardless of order files.forEach((file, index) =>
const sortedResults = orderBy('name', 'asc')(files);
sortedResults.forEach((file, index) =>
expect(file).toMatchObject({ expect(file).toMatchObject({
...fileInfo[index], ...fileInfo[index],
folder: { folder: {