diff --git a/src/services/misc/__tests__/notes.test.js b/src/services/misc/__tests__/notes.test.js index 44de4e8..db1a1fe 100644 --- a/src/services/misc/__tests__/notes.test.js +++ b/src/services/misc/__tests__/notes.test.js @@ -10,12 +10,18 @@ jest.unstable_mockModule('../../../database/database.js', () => ({ recursivelyDeleteChildObjects: jest.fn(), getModelStats: jest.fn(), getModelHistory: jest.fn(), + aggregateRollups: jest.fn(), + aggregateRollupsHistory: jest.fn(), })); jest.unstable_mockModule('../../../database/schemas/misc/note.schema.js', () => ({ noteModel: { modelName: 'Note' }, })); +jest.unstable_mockModule('../../../utils.js', () => ({ + newNoteNotification: jest.fn(), +})); + jest.unstable_mockModule('log4js', () => ({ default: { getLogger: () => ({ @@ -71,7 +77,12 @@ describe('Note Service Route Handlers', () => { describe('newNoteRouteHandler', () => { it('should create a new note', async () => { - req.body = { content: 'New note', noteType: 'type123' }; + req.body = { + content: 'New note', + noteType: 'type123', + parent: 'parent123', + parentType: 'job', + }; const mockNote = { _id: '456', ...req.body }; newObject.mockResolvedValue(mockNote);