diff --git a/src/modules/models/someone-once-said/service/someone-once-said.service.spec.ts b/src/modules/models/someone-once-said/service/someone-once-said.service.spec.ts index 3bc98dd..7cbcbf9 100644 --- a/src/modules/models/someone-once-said/service/someone-once-said.service.spec.ts +++ b/src/modules/models/someone-once-said/service/someone-once-said.service.spec.ts @@ -14,6 +14,7 @@ describe('SomeoneOnceSaidService', () => { phrase: 'Test quote', username: 'testUser', secName: 'Teschter', + serverId: 'someid', createdAt: mockDate, }; const mockQuoteDocument: SomeoneOnceSaidDocument = { @@ -64,6 +65,7 @@ describe('SomeoneOnceSaidService', () => { const mockQuoteDto: SomeoneOnceSaidEntity = { phrase: 'Test quote', username: 'testUser', + serverId: 'someid', createdAt: mockDate, }; (modelMock as any).create = jest.fn((p) => new Error('Test error')); @@ -74,7 +76,6 @@ describe('SomeoneOnceSaidService', () => { }); }); - describe('getRandomQuote', () => { it('should return a random quote', async () => { (modelMock as any).findOne = jest.fn((p) => ({ @@ -85,7 +86,7 @@ describe('SomeoneOnceSaidService', () => { const countSpy = jest.spyOn(modelMock, 'countDocuments'); const findOneSpy = jest.spyOn(modelMock, 'findOne'); - const result = await service.getRandomQuote(); + const result = await service.getRandomQuote('someid'); expect(result).toStrictEqual(mockQuoteDocument); expect(countSpy).toHaveBeenCalled(); @@ -97,7 +98,7 @@ describe('SomeoneOnceSaidService', () => { (p) => new Error('Test error'), ); - const result = await service.getRandomQuote(); + const result = await service.getRandomQuote('someid'); expect(result).toBeNull(); });