Chore: Deprecate folderIDs from testCases (#77649)

This commit is contained in:
Kat Yang 2023-11-07 09:51:18 -05:00 committed by GitHub
parent 59df27cd27
commit a7d08997f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 8 deletions

View File

@ -897,7 +897,8 @@ func TestIntegrationFindDashboardsByFolder(t *testing.T) {
} }
testCases := []struct { testCases := []struct {
desc string desc string
// Deprecated: use FolderUID instead
folderIDs []int64 folderIDs []int64
folderUIDs []string folderUIDs []string
query string query string
@ -906,7 +907,7 @@ func TestIntegrationFindDashboardsByFolder(t *testing.T) {
}{ }{
{ {
desc: "find dashboard under general using folder id", desc: "find dashboard under general using folder id",
folderIDs: []int64{0}, folderIDs: []int64{0}, // nolint:staticcheck
typ: searchstore.TypeDashboard, typ: searchstore.TypeDashboard,
expectedResult: map[string][]res{ expectedResult: map[string][]res{
"": {{title: "dashboard under general"}}, "": {{title: "dashboard under general"}},
@ -915,7 +916,7 @@ func TestIntegrationFindDashboardsByFolder(t *testing.T) {
}, },
{ {
desc: "find dashboard under general using folder id", desc: "find dashboard under general using folder id",
folderIDs: []int64{0}, folderIDs: []int64{0}, // nolint:staticcheck
typ: searchstore.TypeDashboard, typ: searchstore.TypeDashboard,
expectedResult: map[string][]res{ expectedResult: map[string][]res{
"": {{title: "dashboard under general"}}, "": {{title: "dashboard under general"}},
@ -924,7 +925,7 @@ func TestIntegrationFindDashboardsByFolder(t *testing.T) {
}, },
{ {
desc: "find dashboard under f0 using folder id", desc: "find dashboard under f0 using folder id",
folderIDs: []int64{f0.ID}, folderIDs: []int64{f0.ID}, // nolint:staticcheck
typ: searchstore.TypeDashboard, typ: searchstore.TypeDashboard,
expectedResult: map[string][]res{ expectedResult: map[string][]res{
"": {{title: "dashboard under f0", folderUID: f0.UID, folderTitle: f0.Title}}, "": {{title: "dashboard under f0", folderUID: f0.UID, folderTitle: f0.Title}},
@ -932,7 +933,7 @@ func TestIntegrationFindDashboardsByFolder(t *testing.T) {
}, },
{ {
desc: "find dashboard under f0 or f1 using folder id", desc: "find dashboard under f0 or f1 using folder id",
folderIDs: []int64{f0.ID, f1.ID}, folderIDs: []int64{f0.ID, f1.ID}, // nolint:staticcheck
typ: searchstore.TypeDashboard, typ: searchstore.TypeDashboard,
expectedResult: map[string][]res{ expectedResult: map[string][]res{
"": {{title: "dashboard under f0", folderUID: f0.UID, folderTitle: f0.Title}, "": {{title: "dashboard under f0", folderUID: f0.UID, folderTitle: f0.Title},
@ -981,7 +982,7 @@ func TestIntegrationFindDashboardsByFolder(t *testing.T) {
}, },
{ {
desc: "find dashboard under general or f0 using folder id", desc: "find dashboard under general or f0 using folder id",
folderIDs: []int64{0, f0.ID}, folderIDs: []int64{0, f0.ID}, // nolint:staticcheck
typ: searchstore.TypeDashboard, typ: searchstore.TypeDashboard,
expectedResult: map[string][]res{ expectedResult: map[string][]res{
"": {{title: "dashboard under f0", folderUID: f0.UID, folderTitle: f0.Title}, "": {{title: "dashboard under f0", folderUID: f0.UID, folderTitle: f0.Title},
@ -992,7 +993,7 @@ func TestIntegrationFindDashboardsByFolder(t *testing.T) {
}, },
{ {
desc: "find dashboard under general or f0 or f1 using folder id", desc: "find dashboard under general or f0 or f1 using folder id",
folderIDs: []int64{0, f0.ID, f1.ID}, folderIDs: []int64{0, f0.ID, f1.ID}, // nolint:staticcheck
typ: searchstore.TypeDashboard, typ: searchstore.TypeDashboard,
expectedResult: map[string][]res{ expectedResult: map[string][]res{
"": {{title: "dashboard under f0", folderUID: f0.UID, folderTitle: f0.Title}, "": {{title: "dashboard under f0", folderUID: f0.UID, folderTitle: f0.Title},
@ -1046,7 +1047,7 @@ func TestIntegrationFindDashboardsByFolder(t *testing.T) {
res, err := dashboardStore.FindDashboards(context.Background(), &dashboards.FindPersistedDashboardsQuery{ res, err := dashboardStore.FindDashboards(context.Background(), &dashboards.FindPersistedDashboardsQuery{
SignedInUser: user, SignedInUser: user,
Type: tc.typ, Type: tc.typ,
FolderIds: tc.folderIDs, FolderIds: tc.folderIDs, // nolint:staticcheck
FolderUIDs: tc.folderUIDs, FolderUIDs: tc.folderUIDs,
}) })
require.NoError(t, err) require.NoError(t, err)