Plugins: Migrate PluginStore mock to pre-existing fakes package (#71664)
* migrate to existing fakes package * fix imports
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
|
||||
"github.com/grafana/grafana/pkg/infra/log"
|
||||
"github.com/grafana/grafana/pkg/plugins"
|
||||
"github.com/grafana/grafana/pkg/plugins/manager/fakes"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -33,7 +34,7 @@ func TestConfigReader(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Unknown app plugin should return error", func(t *testing.T) {
|
||||
cfgProvider := newConfigReader(log.New("test logger"), plugins.FakePluginStore{})
|
||||
cfgProvider := newConfigReader(log.New("test logger"), &fakes.FakePluginStore{})
|
||||
_, err := cfgProvider.readConfig(context.Background(), unknownApp)
|
||||
require.Error(t, err)
|
||||
require.Equal(t, "plugin not installed: \"nonexisting\"", err.Error())
|
||||
@@ -47,7 +48,7 @@ func TestConfigReader(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("Can read correct properties", func(t *testing.T) {
|
||||
pm := plugins.FakePluginStore{
|
||||
pm := &fakes.FakePluginStore{
|
||||
PluginList: []plugins.PluginDTO{
|
||||
{JSONData: plugins.JSONData{ID: "test-plugin"}},
|
||||
{JSONData: plugins.JSONData{ID: "test-plugin-2"}},
|
||||
|
||||
Reference in New Issue
Block a user