grafana/pkg/services/serviceaccounts/manager/service_test.go
Vardan Torosyan f1661166b2
Service accounts: Grafana service accounts are enabled by default (#51402)
* Remove feature flag for service accounts

* Fix failing tests and remove remaining usage

* Fix failing tests and remove remaining usage
2022-06-27 10:22:49 +02:00

21 lines
590 B
Go

package manager
import (
"context"
"testing"
"github.com/grafana/grafana/pkg/services/serviceaccounts/tests"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestProvideServiceAccount_DeleteServiceAccount(t *testing.T) {
t.Run("should call store function", func(t *testing.T) {
storeMock := &tests.ServiceAccountsStoreMock{Calls: tests.Calls{}}
svc := ServiceAccountsService{store: storeMock}
err := svc.DeleteServiceAccount(context.Background(), 1, 1)
require.NoError(t, err)
assert.Len(t, storeMock.Calls.DeleteServiceAccount, 1)
})
}