test(config): authProviders parsing; fixture carries the new field

This commit is contained in:
bchanot committed 2026-10-11 23:16:57 +02:00
1 parent b10b227ee9
commit 0f7292f9b3
2 files changed
+20 -1

No files matched your search

+19 -1
View File
@@ -1,5 +1,9 @@
import { describe, it, expect } from 'vitest'
import { resolveConfig, resolveSupabaseConnection } from '@/config/env'
import {
resolveAuthProviders,
resolveConfig,
resolveSupabaseConnection,
} from '@/config/env'
describe('resolveConfig', () => {
it('keeps the identity defaults and no Supabase when nothing is injected', () => {
@@ -35,3 +39,17 @@ describe('resolveSupabaseConnection', () => {
expect(resolveSupabaseConnection(undefined, 'key')).toBeNull()
})
})
describe('resolveAuthProviders', () => {
it('is empty by default', () => {
expect(resolveConfig({}).authProviders).toEqual([])
expect(resolveAuthProviders('')).toEqual([])
})
it('parses a comma list, trims, lowercases, dedupes and drops unknown names', () => {
expect(resolveAuthProviders(' Google, apple ,google,facebook')).toEqual([
'google',
'apple',
])
})
})
+1
View File
@@ -8,6 +8,7 @@ const base: AppConfig = {
footerName: 'F',
tagline: 'T',
supabase: null,
authProviders: [],
}
describe('getSupabaseClient', () => {