2022-01-26 11:44:20 -06:00
|
|
|
package featuremgmt
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
2023-01-23 10:53:43 -06:00
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/setting"
|
2022-01-26 11:44:20 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestFeatureService(t *testing.T) {
|
|
|
|
cfg := setting.NewCfg()
|
2024-01-28 17:22:45 -06:00
|
|
|
mgmt, err := ProvideManagerService(cfg)
|
2022-01-26 11:44:20 -06:00
|
|
|
require.NoError(t, err)
|
|
|
|
require.NotNil(t, mgmt)
|
|
|
|
|
|
|
|
// Enterprise features do not fall though automatically
|
2023-11-14 14:50:27 -06:00
|
|
|
require.False(t, mgmt.IsEnabledGlobally("a.yes.default"))
|
|
|
|
require.False(t, mgmt.IsEnabledGlobally("a.yes")) // licensed, but not enabled
|
2022-01-26 11:44:20 -06:00
|
|
|
}
|