mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
refactor(core): Delete all collaboration related code (no-changelog) (#9929)
This commit is contained in:
committed by
GitHub
parent
24091dfd9b
commit
22990342df
@@ -1,14 +1,16 @@
|
||||
import type { WebSocket } from 'ws';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
|
||||
import config from '@/config';
|
||||
import type { User } from '@db/entities/User';
|
||||
import { Push } from '@/push';
|
||||
import { SSEPush } from '@/push/sse.push';
|
||||
import { WebSocketPush } from '@/push/websocket.push';
|
||||
import type { WebSocketPushRequest, SSEPushRequest } from '@/push/types';
|
||||
import { mockInstance } from '../../shared/mocking';
|
||||
import { mock } from 'jest-mock-extended';
|
||||
import { BadRequestError } from '@/errors/response-errors/bad-request.error';
|
||||
|
||||
import { mockInstance } from '../../shared/mocking';
|
||||
|
||||
jest.unmock('@/push');
|
||||
|
||||
describe('Push', () => {
|
||||
@@ -19,7 +21,7 @@ describe('Push', () => {
|
||||
|
||||
test('should validate pushRef on requests for websocket backend', () => {
|
||||
config.set('push.backend', 'websocket');
|
||||
const push = new Push();
|
||||
const push = new Push(mock());
|
||||
const ws = mock<WebSocket>();
|
||||
const request = mock<WebSocketPushRequest>({ user, ws });
|
||||
request.query = { pushRef: '' };
|
||||
@@ -32,7 +34,7 @@ describe('Push', () => {
|
||||
|
||||
test('should validate pushRef on requests for SSE backend', () => {
|
||||
config.set('push.backend', 'sse');
|
||||
const push = new Push();
|
||||
const push = new Push(mock());
|
||||
const request = mock<SSEPushRequest>({ user, ws: undefined });
|
||||
request.query = { pushRef: '' };
|
||||
expect(() => push.handleRequest(request, mock())).toThrow(BadRequestError);
|
||||
|
||||
Reference in New Issue
Block a user