Chore: GetDashboardQuery should be dispatched using DispatchCtx (#36877)

* Chore: GetDashboardQuery should be dispatched using DispatchCtx

* Fix after merge

* Changes after review

* Various fixes

* Use GetDashboardCtx function instead of GetDashboard
This commit is contained in:
Marcus Efraimsson
2021-09-14 16:08:04 +02:00
committed by GitHub
parent 2b1d3d27e4
commit fa9857499b
28 changed files with 149 additions and 135 deletions

View File

@ -56,7 +56,7 @@ func TestDashboardDataAccess(t *testing.T) {
OrgId: 1,
}
err := GetDashboard(&query)
err := GetDashboardCtx(context.Background(), &query)
So(err, ShouldBeNil)
So(query.Result.Title, ShouldEqual, "test dash 23")
@ -72,7 +72,7 @@ func TestDashboardDataAccess(t *testing.T) {
OrgId: 1,
}
err := GetDashboard(&query)
err := GetDashboardCtx(context.Background(), &query)
So(err, ShouldBeNil)
So(query.Result.Title, ShouldEqual, "test dash 23")
@ -88,7 +88,7 @@ func TestDashboardDataAccess(t *testing.T) {
OrgId: 1,
}
err := GetDashboard(&query)
err := GetDashboardCtx(context.Background(), &query)
So(err, ShouldBeNil)
So(query.Result.Title, ShouldEqual, "test dash 23")
@ -103,7 +103,7 @@ func TestDashboardDataAccess(t *testing.T) {
OrgId: 1,
}
err := GetDashboard(&query)
err := GetDashboardCtx(context.Background(), &query)
So(err, ShouldEqual, models.ErrDashboardIdentifierNotSet)
})
@ -191,7 +191,7 @@ func TestDashboardDataAccess(t *testing.T) {
OrgId: 1,
}
err = GetDashboard(&query)
err = GetDashboardCtx(context.Background(), &query)
So(err, ShouldBeNil)
So(query.Result.FolderId, ShouldEqual, 0)
So(query.Result.CreatedBy, ShouldEqual, savedDash.CreatedBy)