mirror of
https://github.com/grafana/grafana.git
synced 2026-09-05 04:40:13 -05:00
Chore: Remove mockstore and use dbtest instead (#61629)
* remove mockstore and use dbtest instead * fix wire * remove unused expected fields * fix more tests in alerting * fix api tests
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/db"
|
||||
"github.com/grafana/grafana/pkg/infra/db/dbtest"
|
||||
"github.com/grafana/grafana/pkg/infra/log/logtest"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
"github.com/grafana/grafana/pkg/services/accesscontrol"
|
||||
@@ -20,7 +21,6 @@ import (
|
||||
"github.com/grafana/grafana/pkg/services/org"
|
||||
pref "github.com/grafana/grafana/pkg/services/preference"
|
||||
"github.com/grafana/grafana/pkg/services/preference/preftest"
|
||||
"github.com/grafana/grafana/pkg/services/sqlstore/mockstore"
|
||||
"github.com/grafana/grafana/pkg/services/team"
|
||||
"github.com/grafana/grafana/pkg/services/team/teamimpl"
|
||||
"github.com/grafana/grafana/pkg/services/team/teamtest"
|
||||
@@ -38,7 +38,7 @@ func TestTeamAPIEndpoint(t *testing.T) {
|
||||
store.Cfg = hs.Cfg
|
||||
hs.teamService = teamimpl.ProvideService(store, hs.Cfg)
|
||||
hs.SQLStore = store
|
||||
mock := &mockstore.SQLStoreMock{}
|
||||
mock := dbtest.NewFakeDB()
|
||||
|
||||
loggedInUserScenarioWithRole(t, "When admin is calling GET on", "GET", "/api/teams/search", "/api/teams/search",
|
||||
org.RoleAdmin, func(sc *scenarioContext) {
|
||||
@@ -108,7 +108,7 @@ func TestTeamAPIEndpoint(t *testing.T) {
|
||||
t.Run("When creating team with API key", func(t *testing.T) {
|
||||
hs := setupSimpleHTTPServer(nil)
|
||||
hs.Cfg.EditorsCanAdmin = true
|
||||
hs.SQLStore = mockstore.NewSQLStoreMock()
|
||||
hs.SQLStore = dbtest.NewFakeDB()
|
||||
hs.teamService = &teamtest.FakeService{}
|
||||
teamName := "team foo"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user