Skip to content

Stopped using outbox in member welcome email service tests#28699

Open
EvanHahn wants to merge 1 commit into
mainfrom
trim-member-welcome-email-tests-with-outbox
Open

Stopped using outbox in member welcome email service tests#28699
EvanHahn wants to merge 1 commit into
mainfrom
trim-member-welcome-email-tests-with-outbox

Conversation

@EvanHahn

Copy link
Copy Markdown
Contributor

towards https://linear.app/ghost/issue/NY-1220

This makes the tests for member welcome emails service more realistic. The real code doesn't use the outbox, but the tests used it. Let's remove that.

towards https://linear.app/ghost/issue/NY-1220

This makes the tests for member welcome emails service more realistic.
The real code doesn't use the outbox, but the tests used it. Let's
remove that.
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 986e4126-aeeb-42b8-98df-00c44fa4aee4

📥 Commits

Reviewing files that changed from the base of the PR and between 3aeba4a and 068a13b.

📒 Files selected for processing (1)
  • ghost/core/test/integration/services/member-welcome-emails.test.js

Walkthrough

The integration tests for member welcome emails are refactored in a single file. The MESSAGES constant is imported to validate specific error messages. Outbox table cleanup is removed from beforeEach/afterEach hooks. A new sendMemberWelcomeEmail helper is introduced that initialises the service, loads templates, and directly calls memberWelcomeEmailService.api.send. The describe block is renamed from "Outbox processing for welcome emails" to "Sending welcome emails". All test cases are updated: error scenarios use assert.rejects with MESSAGES.* constants and sinon.assert.notCalled, while sender-resolution tests replace models.Outbox.add and outbox-job execution with direct sendMemberWelcomeEmail calls, keeping existing mailer call assertions.

Possibly related PRs

  • TryGhost/Ghost#28697: Adds E2E assertions that inactive/deactivated automations result in zero member-welcome-email sends, directly related to the same memberWelcomeEmailService and GhostMailer.send stubbing patterns being refactored here.

Suggested reviewers

  • troyciesco
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: removing outbox usage from member welcome email service tests, which aligns with the changeset that refactors tests away from outbox/job scheduling toward direct service invocation.
Description check ✅ Passed The description is clearly related to the changeset, explaining the motivation (tests should match real code behavior) and the specific change (removing outbox from member welcome email tests).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch trim-member-welcome-email-tests-with-outbox

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nx-cloud

nx-cloud Bot commented Jun 18, 2026

Copy link
Copy Markdown

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 068a13b

Command Status Duration Result
nx run ghost:test:ci:integration:no-coverage ✅ Succeeded 2m 8s View ↗
nx run ghost:test:ci:integration ✅ Succeeded 1m 25s View ↗
nx run ghost:test:ci:e2e:no-coverage ✅ Succeeded 3m 58s View ↗
nx run ghost:test:ci:e2e ✅ Succeeded 3m 55s View ↗
nx run ghost:test:ci:legacy ✅ Succeeded 2m 18s View ↗
nx run-many -t lint -p ghost ✅ Succeeded 49s View ↗
nx run-many -t test:unit -p ghost ✅ Succeeded 32s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-06-18 02:09:38 UTC

@EvanHahn EvanHahn requested a review from troyciesco June 18, 2026 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant