test(config): authProviders parsing; fixture carries the new field
This commit is contained in:
1 parent
b10b227ee9
commit
0f7292f9b3
2 files changed
+20
-1
No files matched your search
@@ -1,5 +1,9 @@
|
|||||||
import { describe, it, expect } from 'vitest'
|
import { describe, it, expect } from 'vitest'
|
||||||
import { resolveConfig, resolveSupabaseConnection } from '@/config/env'
|
import {
|
||||||
|
resolveAuthProviders,
|
||||||
|
resolveConfig,
|
||||||
|
resolveSupabaseConnection,
|
||||||
|
} from '@/config/env'
|
||||||
|
|
||||||
describe('resolveConfig', () => {
|
describe('resolveConfig', () => {
|
||||||
it('keeps the identity defaults and no Supabase when nothing is injected', () => {
|
it('keeps the identity defaults and no Supabase when nothing is injected', () => {
|
||||||
@@ -35,3 +39,17 @@ describe('resolveSupabaseConnection', () => {
|
|||||||
expect(resolveSupabaseConnection(undefined, 'key')).toBeNull()
|
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',
|
||||||
|
])
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -8,6 +8,7 @@ const base: AppConfig = {
|
|||||||
footerName: 'F',
|
footerName: 'F',
|
||||||
tagline: 'T',
|
tagline: 'T',
|
||||||
supabase: null,
|
supabase: null,
|
||||||
|
authProviders: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
describe('getSupabaseClient', () => {
|
describe('getSupabaseClient', () => {
|
||||||
|
|||||||
Reference in new issue
Block a user