fix: skip auth requirement for config-defined custom providers
Shows the auth panel only when provider credentials are actually required Keeps custom providers defined in config from being treated as incomplete Adds coverage for the new provider auth check
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, test } from 'bun:test';
|
||||
import { shouldLoadAvailableProviders } from './providerAvailability';
|
||||
import { requiresProviderAuth, shouldLoadAvailableProviders } from './providerAvailability';
|
||||
import {
|
||||
getOAuthAuthMethods,
|
||||
normalizeAuthType,
|
||||
@@ -15,6 +15,14 @@ describe('ProvidersPage available provider loading', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('ProvidersPage provider authentication', () => {
|
||||
test('does not require credentials for a custom provider defined in config', () => {
|
||||
expect(requiresProviderAuth(true, false, true)).toBe(false);
|
||||
expect(requiresProviderAuth(true, false, false)).toBe(true);
|
||||
expect(requiresProviderAuth(true, true, false)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe('provider auth method helpers', () => {
|
||||
test('normalizeAuthType recognizes oauth and api labels', () => {
|
||||
expect(normalizeAuthType({ type: 'oauth', label: 'Login with Cursor' })).toBe('oauth');
|
||||
|
||||
Reference in New Issue
Block a user