mirror of
https://github.com/supabase/supabase.git
synced 2026-12-03 23:18:57 +00:00
24 lines
781 B
TypeScript
24 lines
781 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { getReplicationDestinationType } from './Nodes.utils'
|
|
|
|
describe('getReplicationDestinationType', () => {
|
|
it.each([
|
|
['big_query', 'BigQuery'],
|
|
['ducklake', 'DuckLake'],
|
|
['snowflake', 'Snowflake'],
|
|
['clickhouse', 'ClickHouse'],
|
|
])('maps %s configs to %s', (key, expected) => {
|
|
expect(getReplicationDestinationType({ [key]: {} })).toBe(expected)
|
|
})
|
|
|
|
it('renders unrecognized configurations anonymously', () => {
|
|
expect(getReplicationDestinationType({ iceberg: {} })).toBe('Unknown')
|
|
expect(getReplicationDestinationType({})).toBe('Unknown')
|
|
})
|
|
|
|
it('returns undefined while the configuration is missing', () => {
|
|
expect(getReplicationDestinationType(undefined)).toBeUndefined()
|
|
})
|
|
})
|