refactor(core): Delete all collaboration related code (no-changelog) (#9929)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-07-03 18:46:24 +02:00
committed by GitHub
parent 24091dfd9b
commit 22990342df
23 changed files with 57 additions and 911 deletions

View File

@@ -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);