mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
feat: Add RS client to hooks service (#9834)
This commit is contained in:
@@ -12,6 +12,9 @@ import { HooksService } from '@/services/hooks.service';
|
||||
import type { Invitation } from '@/Interfaces';
|
||||
import type { AuthenticatedRequest } from '@/requests';
|
||||
import type { AuthUserRepository } from '@/databases/repositories/authUser.repository';
|
||||
import RudderStack from '@rudderstack/rudder-sdk-node';
|
||||
|
||||
jest.mock('@rudderstack/rudder-sdk-node');
|
||||
|
||||
describe('HooksService', () => {
|
||||
const mockedUser = mock<AuthUser>();
|
||||
@@ -148,4 +151,14 @@ describe('HooksService', () => {
|
||||
expect(collections).toHaveProperty('Credentials');
|
||||
expect(collections).toHaveProperty('Workflow');
|
||||
});
|
||||
|
||||
it('hooksService.getRudderStackClient', async () => {
|
||||
// ACT
|
||||
const key = 'TEST';
|
||||
const opts = { dataPlaneUrl: 'test.com' };
|
||||
const client = hooksService.getRudderStackClient(key, opts);
|
||||
|
||||
expect(client instanceof RudderStack).toBeTruthy();
|
||||
expect(RudderStack).toHaveBeenCalledWith(key, opts);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user