mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Fix folders flaky test (#81234)
It used to wrongly assume slice ordering
This commit is contained in:
parent
6218e28ee9
commit
6e827889b4
@ -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…
Reference in New Issue
Block a user