Added members_single_opt_in computed setting for single opt-in signup#26801
Added members_single_opt_in computed setting for single opt-in signup#26801
members_single_opt_in computed setting for single opt-in signup#26801Conversation
|
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 ignored due to path filters (2)
📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (4)
WalkthroughAdds a new boolean setting 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan for PR comments
Comment |
51df4fc to
2119e61
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
ghost/core/test/e2e-api/admin/settings.test.js (1)
14-14: Assertmembers_single_opt_indirectly instead of only bumping the count.
matchSettingsArray()mostly validates length, so this still passes if the new key disappears and some other setting keeps the total at 100. Please add a focused assertion formembers_single_opt_in, ideally on the public/Content API response this PR is targeting.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@ghost/core/test/e2e-api/admin/settings.test.js` at line 14, The test relies only on CURRENT_SETTINGS_COUNT and matchSettingsArray(), which primarily checks length, so add a focused assertion to explicitly verify the presence and value of the members_single_opt_in setting (instead of relying on count). Update the test in settings.test.js to fetch the public/Content API response used in this PR and assert that response.settings (or the settings array/object returned by that API) contains a key members_single_opt_in with the expected boolean/string value; keep the existing matchSettingsArray/CURRENT_SETTINGS_COUNT check but add this explicit assertion to prevent silent regressions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@ghost/core/test/e2e-api/admin/settings.test.js`:
- Line 14: The test relies only on CURRENT_SETTINGS_COUNT and
matchSettingsArray(), which primarily checks length, so add a focused assertion
to explicitly verify the presence and value of the members_single_opt_in setting
(instead of relying on count). Update the test in settings.test.js to fetch the
public/Content API response used in this PR and assert that response.settings
(or the settings array/object returned by that API) contains a key
members_single_opt_in with the expected boolean/string value; keep the existing
matchSettingsArray/CURRENT_SETTINGS_COUNT check but add this explicit assertion
to prevent silent regressions.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 644304fb-36eb-4026-b599-747c6c1009e3
⛔ Files ignored due to path filters (1)
ghost/core/test/e2e-api/admin/__snapshots__/settings.test.js.snapis excluded by!**/*.snap
📒 Files selected for processing (5)
ghost/core/core/server/services/settings-helpers/settings-helpers.jsghost/core/core/server/services/settings/settings-service.jsghost/core/core/shared/settings-cache/public.jsghost/core/test/e2e-api/admin/settings.test.jsghost/core/test/unit/server/services/settings-helpers/settings-helpers.test.js
🚧 Files skipped from review as they are similar to previous changes (1)
- ghost/core/core/server/services/settings/settings-service.js
no ref This is the first step toward native single opt-in support. The setting is derived from the `hostSettings:membersSingleOptIn:enabled` config value (managed by host) and exposed to frontends via the Content API public settings response.
2119e61 to
dc327c0
Compare
|
The work for this change is currently postponed |
no ref
This is the first step toward native single opt-in support. The setting is derived from the
hostSettings:membersSingleOptIn:enabledconfig value (managed by host) and exposed to frontends via the Content API public settings response.