Plugins: Migrate PluginStore mock to pre-existing fakes package (#71664)

* migrate to existing fakes package

* fix imports
This commit is contained in:
Will Browne
2023-07-17 12:21:44 +02:00
committed by GitHub
parent d707377700
commit a8577c21ba
22 changed files with 93 additions and 86 deletions

View File

@ -17,6 +17,7 @@ import (
"github.com/grafana/grafana/pkg/login/social"
"github.com/grafana/grafana/pkg/plugins"
"github.com/grafana/grafana/pkg/plugins/config"
"github.com/grafana/grafana/pkg/plugins/manager/fakes"
"github.com/grafana/grafana/pkg/plugins/pluginscdn"
accesscontrolmock "github.com/grafana/grafana/pkg/services/accesscontrol/mock"
"github.com/grafana/grafana/pkg/services/featuremgmt"
@ -47,7 +48,7 @@ func setupTestEnvironment(t *testing.T, cfg *setting.Cfg, features *featuremgmt.
var pluginStore = pstore
if pluginStore == nil {
pluginStore = &plugins.FakePluginStore{}
pluginStore = &fakes.FakePluginStore{}
}
var pluginsSettings = psettings
@ -218,7 +219,7 @@ func TestHTTPServer_GetFrontendSettings_apps(t *testing.T) {
{
desc: "disabled app with preload",
pluginStore: func() plugins.Store {
return &plugins.FakePluginStore{
return &fakes.FakePluginStore{
PluginList: []plugins.PluginDTO{
{
Module: fmt.Sprintf("/%s/module.js", "test-app"),
@ -251,7 +252,7 @@ func TestHTTPServer_GetFrontendSettings_apps(t *testing.T) {
{
desc: "enabled app with preload",
pluginStore: func() plugins.Store {
return &plugins.FakePluginStore{
return &fakes.FakePluginStore{
PluginList: []plugins.PluginDTO{
{
Module: fmt.Sprintf("/%s/module.js", "test-app"),
@ -284,7 +285,7 @@ func TestHTTPServer_GetFrontendSettings_apps(t *testing.T) {
{
desc: "angular app plugin",
pluginStore: func() plugins.Store {
return &plugins.FakePluginStore{
return &fakes.FakePluginStore{
PluginList: []plugins.PluginDTO{
{
Module: fmt.Sprintf("/%s/module.js", "test-app"),