From f52ec1c78bf0ee9f14f4ccb1ce328af92c2fd237 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Fri, 27 Dec 2024 19:19:52 -0300 Subject: [PATCH] fix dbWatchersDisabled: test --- .../unit/app/lib/server/lib/notifyListener.spec.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/meteor/tests/unit/app/lib/server/lib/notifyListener.spec.ts b/apps/meteor/tests/unit/app/lib/server/lib/notifyListener.spec.ts index 60b01dcefd12..a07a52b79e74 100644 --- a/apps/meteor/tests/unit/app/lib/server/lib/notifyListener.spec.ts +++ b/apps/meteor/tests/unit/app/lib/server/lib/notifyListener.spec.ts @@ -23,7 +23,7 @@ describe('Message Broadcast Tests', () => { _updatedAt: new Date(), }; - const modelsStubs = () => ({ + const modelsStubs = (dbWatchersDisabled: boolean) => ({ Messages: { findOneById: messagesFindOneStub, }, @@ -33,13 +33,13 @@ describe('Message Broadcast Tests', () => { Settings: { getValueById: getSettingValueByIdStub, }, + dbWatchersDisabled, }); - const coreStubs = (dbWatchersDisabled: boolean) => ({ + const coreStubs = () => ({ api: { broadcast: broadcastStub, }, - dbWatchersDisabled, }); beforeEach(() => { @@ -50,7 +50,7 @@ describe('Message Broadcast Tests', () => { memStub = sinon.stub().callsFake((fn: any) => fn); const proxyMock = proxyquire.noPreserveCache().load('../../../../../../app/lib/server/lib/notifyListener', { - '@rocket.chat/models': modelsStubs(), + '@rocket.chat/models': modelsStubs(false), '@rocket.chat/core-services': coreStubs(false), 'mem': memStub, }); @@ -203,8 +203,8 @@ describe('Message Broadcast Tests', () => { describe('notifyOnMessageChange', () => { const setupProxyMock = (dbWatchersDisabled: boolean) => { const proxyMock = proxyquire.noCallThru().load('../../../../../../app/lib/server/lib/notifyListener', { - '@rocket.chat/models': modelsStubs(), - '@rocket.chat/core-services': coreStubs(dbWatchersDisabled), + '@rocket.chat/models': modelsStubs(dbWatchersDisabled), + '@rocket.chat/core-services': coreStubs(), 'mem': memStub, }); notifyOnMessageChange = proxyMock.notifyOnMessageChange;