Auth: Remove oAuthProviders from Social service (#78732)

* Remove oauthProviders from social svc

* Add EnabledFn to supportbundles.Collector
This commit is contained in:
Misi
2023-11-30 09:30:35 +01:00
committed by GitHub
parent 86311e3a33
commit 79577e4929
5 changed files with 47 additions and 30 deletions
@@ -38,12 +38,16 @@ func TestService_bundleCreate(t *testing.T) {
cfg := setting.NewCfg()
collector := basicCollector(cfg)
disabledCollector := settingsCollector(setting.ProvideProvider(cfg))
disabledCollector.EnabledFn = func() bool { return false }
s.bundleRegistry.RegisterSupportItemCollector(collector)
s.bundleRegistry.RegisterSupportItemCollector(disabledCollector)
createdBundle, err := s.store.Create(context.Background(), &user.SignedInUser{UserID: 1, Login: "bob"})
require.NoError(t, err)
s.startBundleWork(context.Background(), []string{collector.UID}, createdBundle.UID)
s.startBundleWork(context.Background(), []string{collector.UID, disabledCollector.UID}, createdBundle.UID)
bundle, err := s.get(context.Background(), createdBundle.UID)
require.NoError(t, err)