test(api-service): add E2E tests for agent webhook and reply flows fixes NV-7356#10709
Merged
test(api-service): add E2E tests for agent webhook and reply flows fixes NV-7356#10709
Conversation
Contributor
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis pull request introduces comprehensive end-to-end test coverage for conversational agents functionality. It adds test suites for reply and webhook endpoints, helper utilities for setting up agent test contexts and seeding conversations, and Slack webhook payload builders with signing utilities. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
466d7b7 to
60cb954
Compare
NV-7356 Made-with: Cursor
60cb954 to
c08fc8d
Compare
✅ Deploy Preview for dashboard-v2-novu-staging canceled.
|
Comment on lines
+1
to
+10
| import { | ||
| AgentIntegrationRepository, | ||
| AgentRepository, | ||
| ChannelConnectionRepository, | ||
| ChannelEndpointRepository, | ||
| ConversationActivityRepository, | ||
| ConversationRepository, | ||
| ConversationStatusEnum, | ||
| IntegrationRepository, | ||
| } from '@novu/dal'; |
This was referenced Apr 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds E2E test coverage for the two untested sides of the conversational agents feature:
agent-webhook.e2e.ts) — conversation creation, participant resolution (platform_user vs subscriber), thread reuse, bridge payload shape verification, Slack signature rejection, conversation lifecycle (reopen resolved, participant upgrade)agent-reply.e2e.ts) — reply/update persistence, metadata signals with cumulative 64KB limit, resolve lifecycle with onResolve bridge callback, combined reply+signals+resolve in single requestShared test infrastructure under
helpers/with provider-specific helpers isolated inhelpers/providers/slack.tsfor easy extension to Teams/WhatsApp.Approach
AgentInboundHandler.handle()directly with mock Thread/Message objects, bypassing the Chat SDK's Slack API calls while still exercising the full orchestration: credential resolution → subscriber resolution → conversation service → activity persistence → bridge executor/v1/agents/:agentId/replyendpoint withChatSdkService.postToConversationandBridgeExecutorService.executestubbed via sinon (auto-restored by globalafterEach)Test plan