mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Zanana: Fix list test (#96401)
Fix: List operation are not guaranteed to respond in a certain order
This commit is contained in:
@@ -52,8 +52,16 @@ func testList(t *testing.T, server *Server) {
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, res.GetItems(), 0)
|
||||
assert.Len(t, res.GetFolders(), 2)
|
||||
assert.Equal(t, res.GetFolders()[0], "1")
|
||||
assert.Equal(t, res.GetFolders()[1], "3")
|
||||
|
||||
first := res.GetFolders()[0]
|
||||
second := res.GetFolders()[1]
|
||||
|
||||
if first == "3" {
|
||||
first, second = second, first
|
||||
}
|
||||
|
||||
assert.Equal(t, first, "1")
|
||||
assert.Equal(t, second, "3")
|
||||
})
|
||||
|
||||
t.Run("user:5 should be get list all dashboards.grafana.app/dashboards in folder 1 with set relation", func(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user