Repository navigation
Added settings acceptance coverage for migration gaps - #29408
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
🚧 Files skipped from review as they are similar to previous changes (9)
WalkthroughExpanded Admin acceptance coverage for integrations, welcome emails, membership settings, staff profiles, and site design. Tests now verify persisted settings payloads, modal dirty-state behavior, tier lifecycle changes, image uploads, navigation routes, Unsplash handling, and theme editor routing. Shared selectors and the acceptance worker were updated for welcome-email and Unsplash scenarios. 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
|
| Command | Status | Duration | Result |
|---|---|---|---|
nx run @tryghost/admin:test:acceptance |
✅ Succeeded | 5m 16s | View ↗ |
nx run-many -t test:unit -p @tryghost/admin,@tr... |
✅ Succeeded | 1m 41s | View ↗ |
nx run ghost-monorepo:lint:boundaries |
✅ Succeeded | 22s | View ↗ |
nx run-many -t lint -p @tryghost/admin,@tryghos... |
✅ Succeeded | 59s | View ↗ |
nx run @tryghost/admin:build |
✅ Succeeded | 27s | View ↗ |
nx run-many --target=build --projects=tag:publi... |
✅ Succeeded | 1s | View ↗ |
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗
☁️ Nx Cloud last updated this comment at 2026-07-16 20:48:33 UTC
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
`@apps/admin/src/settings/membership/member-welcome-emails.acceptance.test.tsx`:
- Around line 529-579: Wrap the test flow that uses the window.fetch spy in a
try...finally block, and move fetchSpy.mockRestore() into the finally block so
it always executes when assertions or other operations fail. Keep the existing
preview assertions and cleanup behavior unchanged.
🪄 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: CHILL
Plan: Pro
Run ID: caeb1e47-8be6-4ffd-b79d-c1d5935ae781
📒 Files selected for processing (12)
apps/admin/src/settings/advanced/integrations.acceptance.test.tsxapps/admin/src/settings/email/default-recipients.acceptance.test.tsxapps/admin/src/settings/general/staff-profile.acceptance.test.tsxapps/admin/src/settings/membership/access.acceptance.test.tsxapps/admin/src/settings/membership/member-welcome-emails.acceptance.test.tsxapps/admin/src/settings/membership/portal.acceptance.test.tsxapps/admin/src/settings/membership/tiers.acceptance.test.tsxapps/admin/src/settings/settings.screen.tsapps/admin/src/settings/site/design.acceptance.test.tsxapps/admin/src/settings/site/theme.acceptance.test.tsxapps/admin/test-utils/acceptance/worker.tspackages/testing/test-data/src/selectors/settings.ts
no ref - covers integration toggle save contracts (Unsplash, Pintura, Transistor Active badge) and the upgrade CTA on host-limited integration cards - covers site visibility public/private switching, tier archive/reactivate tab movement, and portal signup-option tier checkbox states - covers the welcome-email customize modal Escape/dirty confirmation family, the paid welcome row with Stripe connected, the newsletter reply-to placeholder branch, and a deterministic stale-preview race case - covers the design Unsplash photo grid (faked external origin), the Theme-tab dirty leave guard, the theme editor overflow-menu entry path, staff profile/cover image uploads, and the my-profile redirect - hardens the flaky default-recipients spec by splitting its chained Save->Saved cycles into independent cases that assert the settings PUT capture instead of transient button labels
c48e13c to
5d2a581
Compare

Additive test coverage for the Admin settings acceptance tier (
apps/admin/src/settings/**), plus one flake hardening. Test code only — no production changes.Coverage restored from the retired settings acceptance suites
{unsplash: true|false}settings PUT contract, and the Active badge tracking the saved state{pintura: true}save contract and the JS/CSS upload fields hiding while the toggle is offhostSettings.limits.customIntegrationsdisables them, including the externalproroute from the CTA — host limits are faked by overriding the bootbrowseConfigresponse{is_private, password}/{is_private: false}PUT contracts/settingsprofile_image/cover_imagekeys in the users PUTParity for client-side behaviors previously asserted only in browser e2e
Thin cases asserting the client contract against the faked Admin API:
visibility: "public"on the tier/my-profileredirects to the current user's own staff profileFlake hardening
default-recipients.acceptance.test.tsx"saves the standard recipient choices" chained three Save→"Saved" cycles in one render and intermittently timed out on the transient "Saved" label under parallel load. Split into three independent parameterized cases that assert thePUT /settings/capture viatoHaveEditedSettings— the actual contract — instead of reading transient button labels. Same payload coverage, no retries, no timeout bumps.Test-infra support (test lane only)
api.unsplash.comadded to the acceptance worker's external-origin blocklist so an unfaked Unsplash call fails the test instead of hitting the network; the design spec fakes/photosand the download ping withfakeEndpoint@tryghost/test-datasettings registry and exposed onsettingsScreenVerification
pnpm nx run @tryghost/admin:test:acceptance: 50 files / 347 tests greenvitest run -c vitest.acceptance.config.ts src/settingsrun 3× consecutively: 283 tests green each runpnpm lintandpnpm typecheckclean inapps/adminandpackages/testing/test-data