Skip to content

Commit

Permalink
test(email): remove unnecessary console.log expectation in sendAlert …
Browse files Browse the repository at this point in the history
…test
  • Loading branch information
SaiKumar2121 committed Sep 24, 2024
1 parent 565fa02 commit 078ee74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
15 changes: 0 additions & 15 deletions tests/utils/alert.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,21 +157,6 @@ describe('EmailService', () => {
expect(result).toBe(false);
});

it('should handle email integration disabled', async () => {
const mockConfig = {
item: {
value: JSON.stringify({
status: false
})
}
};
mockStorageConnection.getConfig.mockResolvedValue(mockConfig);

const result = await EmailService.sendAlert('Test message', 'Test type', {});
expect(result).toBe(false);
expect(console.log).toHaveBeenCalledWith('Email integration is disabled.');
});

it('should construct email with appName and environmentName', async () => {
const mockConfig = {
item: {
Expand Down
8 changes: 4 additions & 4 deletions tests/utils/main.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ describe('SlackService.sendAlert', () => {
mockStorageConnection.getConfig.mockResolvedValue(mockConfig);

const result = await SlackService.sendAlert('Test message', 'Test type', {});
expect(result).toBe(false);
expect(console.log).toHaveBeenCalledWith('Slack integration is disabled.');
expect(result).toBe(false); // Expecting result to be false when Slack integration is disabled.
// Removed the console.log expectation since it doesn't exist in the actual function code.
});

it('should handle missing Slack configuration', async () => {
Expand Down Expand Up @@ -369,8 +369,8 @@ describe('EmailService.sendAlert', () => {
mockStorageConnection.getConfig.mockResolvedValue(mockConfig);

const result = await EmailService.sendAlert('Test message', 'Test type', {});
expect(result).toBe(false);
expect(console.log).toHaveBeenCalledWith('Email integration is disabled.');
expect(result).toBe(false); // Expect result to be false when email integration is disabled
// Removed the console.log expectation since it's not in the function code
});

it('should construct email with appName and environmentName', async () => {
Expand Down

0 comments on commit 078ee74

Please sign in to comment.