-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat eazy sms #5393
Feat eazy sms #5393
Conversation
👷 Deploy request for dev-web-novu pending review.Visit the deploys page to approve it
|
✅ Deploy Preview for novu-design ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@coderabbitai review |
WalkthroughThis update introduces the EazySMS provider to the Novu system for SMS notifications. It includes backend schema updates, new DTOs, provider configurations, and handler implementations. The integration ensures that Novu can utilize EazySMS to send SMS messages, aligning with community requests for more diverse SMS provider options. Changes
Assessment against linked issues
Possibly related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
import { EazySmsProvider } from './eazy-sms.provider'; | ||
|
||
const mockConfig = { | ||
apiKey: 'test-key', | ||
channelId: '[email protected]', | ||
}; | ||
|
||
const mockSMSMessage = { | ||
to: '1234567890', | ||
content: 'sms content', | ||
}; | ||
|
||
test('should trigger eazy-sms library correctly', async () => { | ||
const smsProvider = new EazySmsProvider(mockConfig); | ||
const spy = jest | ||
.spyOn(smsProvider, 'sendMessage') | ||
.mockImplementation(async () => { | ||
return { | ||
id: '2574a339-86ff', | ||
date: new Date().toISOString(), | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
} as any; | ||
}); | ||
|
||
await smsProvider.sendMessage(mockSMSMessage); | ||
expect(spy).toHaveBeenCalled(); | ||
expect(spy).toHaveBeenCalledWith({ | ||
content: 'sms content', | ||
to: '1234567890', | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test for the EazySmsProvider
is well-structured and covers the basic functionality of the sendMessage
method. The use of Jest for spying and mocking the method ensures that the test is isolated and reliable. However, consider adding more test cases to cover error handling and edge cases to ensure robustness.
Would you like me to help in writing additional test cases for error scenarios and edge cases?
fix: readability Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the provider to this file
Added @BiswaViraj. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sr-26 Can you please fix the pipeline errors?
You'll need to add the failing words in the .cspell
file
and also need to regenerate the pnpm.lock file by running pnpm i
Added @BiswaViraj, the package.lock has significant version changes. Is this okay? |
Yes, it is fine |
What change does this PR introduce?
Closes #5195
Why was this change needed?
New Sms Provider.
Other information (Screenshots)