Skip to content

Commit

Permalink
Test logger error called once
Browse files Browse the repository at this point in the history
  • Loading branch information
JstnMcBrd committed Oct 28, 2023
1 parent ec4a40a commit d812c6c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/helpers/actions/messages/replyToMessage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ describe('Replies', () => {
expect(mockChannelSend).not.toHaveBeenCalled();
expect(mockReply).toHaveBeenCalledOnce();
expect(mockReply).toHaveBeenCalledWith(expect.stringContaining('tried to DM you'));
expect(mockLoggerError).toHaveBeenCalledOnce();
expect(mockLoggerError).toHaveBeenCalledWith(
expect.stringContaining('Failed to send direct message'),
expect.any(Error)
Expand Down Expand Up @@ -258,6 +259,7 @@ describe('Cold calls', () => {

await expect(sendMessageInChannel(mockChannel, 'yo')).resolves.toBeNull();
expect(mockChannelSend).toHaveBeenCalledOnce();
expect(mockLoggerError).toHaveBeenCalledOnce();
expect(mockLoggerError).toHaveBeenCalledWith(expect.stringContaining('send message'), error);
});

Expand All @@ -268,6 +270,7 @@ describe('Cold calls', () => {

await expect(sendMessageInChannel(mockChannel, 'yo')).resolves.toBeNull();
expect(mockChannelSend).not.toHaveBeenCalled();
expect(mockLoggerError).toHaveBeenCalledOnce();
expect(mockLoggerError).toHaveBeenCalledWith(
expect.stringContaining('Cannot send in GuildStageVoice channels')
);
Expand Down

0 comments on commit d812c6c

Please sign in to comment.