Files
n8n-enterprise-unlocked/packages/nodes-base/nodes/Snowflake/__tests__/GenericFunctions.test.ts
कारतोफ्फेलस्क्रिप्ट™ 4302c5f474 feat(Snowflake Node): Add support for Key-Pair authentication (#14833)
2025-05-13 10:43:54 +02:00

44 lines
1.0 KiB
TypeScript

import { getConnectionOptions } from '../GenericFunctions';
describe('getConnectionOptions', () => {
const commonOptions = {
account: 'test-account',
database: 'test-database',
schema: 'test-schema',
warehouse: 'test-warehouse',
role: 'test-role',
clientSessionKeepAlive: true,
};
describe('should return connection options', () => {
it('with username and password for password authentication', () => {
const result = getConnectionOptions({
...commonOptions,
authentication: 'password',
username: 'test-username',
password: 'test-password',
});
expect(result).toEqual({
...commonOptions,
username: 'test-username',
password: 'test-password',
});
});
it('with private key for keyPair authentication', () => {
const result = getConnectionOptions({
...commonOptions,
authentication: 'keyPair',
privateKey: 'test-private-key',
});
expect(result).toEqual({
...commonOptions,
authenticator: 'SNOWFLAKE_JWT',
privateKey: 'test-private-key',
});
});
});
});