Chore: Fix folders flaky test (#81234)

It used to wrongly assume slice ordering
This commit is contained in:
Sofia Papagiannaki 2024-01-25 10:55:44 +02:00 committed by GitHub
parent 6218e28ee9
commit 6e827889b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1597,9 +1597,17 @@ func TestIntegrationNestedFolderSharedWithMe(t *testing.T) {
require.NoError(t, err)
require.Len(t, actualFolders, len(tc.expected))
for i, expected := range tc.expected {
actualFolder := actualFolders[i]
require.Equal(t, expected.UID, actualFolder.UID)
for _, expected := range tc.expected {
var actualFolder *folder.Folder
for _, f := range actualFolders {
if f.UID == expected.UID {
actualFolder = f
break
}
}
if actualFolder == nil {
t.Fatalf("expected folder with UID %s not found", expected.UID)
}
if tc.cmd.WithFullpath {
require.Equal(t, expected.Fullpath, actualFolder.Fullpath)
} else {