grafana/pkg/services/featuremgmt/usage_stats_test.go
Ryan McKinley 45d59cf31b
Dashboards: Remove dummy trim dashboard api (#77249)
Co-authored-by: nikimanoledaki <niki.manoledaki@grafana.com>
2023-11-02 08:35:14 -07:00

25 lines
574 B
Go

package featuremgmt
import (
"context"
"testing"
"github.com/stretchr/testify/require"
)
func TestFeatureUsageStats(t *testing.T) {
featureManagerWithAllFeatures := WithFeatures(
"database_metrics",
"live-config",
"UPPER_SNAKE_CASE",
"feature.with.a.dot",
)
require.Equal(t, map[string]any{
"stats.features.database_metrics.count": 1,
"stats.features.live_config.count": 1,
"stats.features.upper_snake_case.count": 1,
"stats.features.feature_with_a_dot.count": 1,
}, featureManagerWithAllFeatures.GetUsageStats(context.Background()))
}