chore: replace artisanal FakeDashboardService with generated mock (#49276)
* chore: replace handmade FakeDashboardService with generated mock Maintaining a handcrafted FakeDashboardService is not sustainable now that we are in the process of moving the dashboard-related functions out of sqlstore. * remove dialect global variable
This commit is contained in:
@@ -242,7 +242,7 @@ func TestDashboardDataAccess(t *testing.T) {
|
||||
SignedInUser: &models.SignedInUser{},
|
||||
}
|
||||
|
||||
err = sqlStore.SearchDashboards(context.Background(), &query)
|
||||
err = dashboardStore.SearchDashboards(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, len(query.Result), 0)
|
||||
@@ -315,7 +315,7 @@ func TestDashboardDataAccess(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := sqlStore.SearchDashboards(context.Background(), &query)
|
||||
err := dashboardStore.SearchDashboards(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, len(query.Result), 1)
|
||||
@@ -339,7 +339,7 @@ func TestDashboardDataAccess(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := sqlStore.SearchDashboards(context.Background(), &query)
|
||||
err := dashboardStore.SearchDashboards(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, len(query.Result), 1)
|
||||
@@ -364,7 +364,7 @@ func TestDashboardDataAccess(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := sqlStore.SearchDashboards(context.Background(), &query)
|
||||
err := dashboardStore.SearchDashboards(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, len(query.Result), 1)
|
||||
@@ -386,7 +386,7 @@ func TestDashboardDataAccess(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := sqlStore.SearchDashboards(context.Background(), &query)
|
||||
err := dashboardStore.SearchDashboards(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, len(query.Result), 3)
|
||||
@@ -407,7 +407,7 @@ func TestDashboardDataAccess(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := sqlStore.SearchDashboards(context.Background(), &query)
|
||||
err := dashboardStore.SearchDashboards(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, len(query.Result), 2)
|
||||
@@ -433,7 +433,7 @@ func TestDashboardDataAccess(t *testing.T) {
|
||||
},
|
||||
}
|
||||
|
||||
err := sqlStore.SearchDashboards(context.Background(), &query)
|
||||
err := dashboardStore.SearchDashboards(context.Background(), &query)
|
||||
require.NoError(t, err)
|
||||
|
||||
require.Equal(t, len(query.Result), 2)
|
||||
@@ -471,7 +471,7 @@ func TestDashboardDataAccess(t *testing.T) {
|
||||
},
|
||||
IsStarred: true,
|
||||
}
|
||||
err = sqlStore.SearchDashboards(context.Background(), &query)
|
||||
err = dashboardStore.SearchDashboards(context.Background(), &query)
|
||||
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, len(query.Result), 1)
|
||||
|
||||
Reference in New Issue
Block a user