Skip to content

Commit

Permalink
fix dbWatchersDisabled: test
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Dec 27, 2024
1 parent 2a8b91e commit f52ec1c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions apps/meteor/tests/unit/app/lib/server/lib/notifyListener.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('Message Broadcast Tests', () => {
_updatedAt: new Date(),
};

const modelsStubs = () => ({
const modelsStubs = (dbWatchersDisabled: boolean) => ({
Messages: {
findOneById: messagesFindOneStub,
},
Expand All @@ -33,13 +33,13 @@ describe('Message Broadcast Tests', () => {
Settings: {
getValueById: getSettingValueByIdStub,
},
dbWatchersDisabled,
});

const coreStubs = (dbWatchersDisabled: boolean) => ({
const coreStubs = () => ({
api: {
broadcast: broadcastStub,
},
dbWatchersDisabled,
});

beforeEach(() => {
Expand All @@ -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,
});
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f52ec1c

Please sign in to comment.