[Fix] Test failing when mailpit enabled - #1179
Conversation
📝 WalkthroughWalkthroughIn ChangesSMTP Connection Failure Test Fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/Feature/NotificationChannelsTest.php`:
- Around line 48-49: The test correctly configures SMTP to fail by setting the
port to a closed port, but it lacks an assertion to verify the error message
shown to the user. Add a session error assertion to validate that the
appropriate error message is stored and displayed, consistent with the pattern
used in the similar test methods test_cannot_add_slack_channel,
test_cannot_add_discord_channel, and test_cannot_add_telegram_channel. This
assertion should verify the error response contains the expected failure message
for SMTP connection issues.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 45a7e440-e922-4b62-9067-e3bb478ace8e
📒 Files selected for processing (1)
tests/Feature/NotificationChannelsTest.php
A test was failing locally when the user had mailpit configured, as a connection to 127.0.0.1 was using the ENVs mail port, which may have been directed towards a mailpit server accepting connections.
Summary by CodeRabbit