Stats: Optimize getting folder stats (#103033)
This commit is contained in:
@@ -85,13 +85,17 @@ func TestIntegrationDashboardDataAccess(t *testing.T) {
|
||||
require.Positive(t, len(savedFolder.UID))
|
||||
})
|
||||
|
||||
t.Run("Should be able to get dashboard counts per org", func(t *testing.T) {
|
||||
t.Run("Should be able to get counts per org", func(t *testing.T) {
|
||||
setup()
|
||||
count, err := dashboardStore.CountInOrg(context.Background(), 1)
|
||||
count, err := dashboardStore.CountInOrg(context.Background(), 1, false)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(3), count)
|
||||
|
||||
count, err = dashboardStore.CountInOrg(context.Background(), 2)
|
||||
count, err = dashboardStore.CountInOrg(context.Background(), 2, false)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(1), count)
|
||||
|
||||
count, err = dashboardStore.CountInOrg(context.Background(), 1, true)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, int64(1), count)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user