Chore: Fix folders flaky test (#81234)

It used to wrongly assume slice ordering
pull/81238/head
Sofia Papagiannaki 2 years ago committed by GitHub
parent 6218e28ee9
commit 6e827889b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 14
      pkg/services/folder/folderimpl/folder_test.go

@ -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 {

Loading…
Cancel
Save