mirror of
https://github.com/grafana/grafana.git
synced 2025-08-02 07:23:11 +08:00
Chore: Avoid showing plugin version if it's %VERSION% (#75974)
This commit is contained in:

committed by
GitHub

parent
d5691e6dd1
commit
1f8b08202e
@ -1,6 +1,7 @@
|
||||
package bootstrap
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
@ -66,6 +67,34 @@ func TestSetDefaultNavURL(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestTemplateDecorateFunc(t *testing.T) {
|
||||
t.Run("Removes %VERSION%", func(t *testing.T) {
|
||||
pluginWithoutVersion := &plugins.Plugin{
|
||||
JSONData: plugins.JSONData{
|
||||
Info: plugins.Info{
|
||||
Version: "%VERSION%",
|
||||
},
|
||||
},
|
||||
}
|
||||
p, err := TemplateDecorateFunc(context.TODO(), pluginWithoutVersion)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "", p.Info.Version)
|
||||
})
|
||||
|
||||
t.Run("Removes %TODAY%", func(t *testing.T) {
|
||||
pluginWithoutVersion := &plugins.Plugin{
|
||||
JSONData: plugins.JSONData{
|
||||
Info: plugins.Info{
|
||||
Version: "%TODAY%",
|
||||
},
|
||||
},
|
||||
}
|
||||
p, err := TemplateDecorateFunc(context.TODO(), pluginWithoutVersion)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "", p.Info.Updated)
|
||||
})
|
||||
}
|
||||
|
||||
func Test_configureAppChildPlugin(t *testing.T) {
|
||||
t.Run("When setting paths based on core plugin on Windows", func(t *testing.T) {
|
||||
child := &plugins.Plugin{
|
||||
|
Reference in New Issue
Block a user