Skip to content

Add JavaScript tests for group notification preferences - #1866

Merged
bor0 merged 2 commits into
WordPress:productionfrom
dan-zakirov:dan/gatherpress-membership-preference-tests
Aug 10, 2026
Merged

bor0 merged 2 commits into
WordPress:productionfrom
dan-zakirov:dan/gatherpress-membership-preference-tests

Conversation

@dan-zakirov

Copy link
Copy Markdown
Contributor

Adds focused JavaScript coverage for the group membership notification preference flow identified during the GatherPress test coverage audit.

The tests cover:

  • a successful opt-in request, including the nonce, JSON payload, and success state
  • rollback and error state when the preference request fails
  • suppression of additional changes while a save is pending, preventing duplicate requests and stale state

See #1863

Screenshots

Not applicable. This is a test-only change.

How to test the changes in this Pull Request:

  1. Run npm ci from the repository root.
  2. Run npm run test --workspace=wporg-groups-frontend -- --runInBand.
  3. Confirm both JavaScript suites pass with 10 tests.
  4. Run npm exec -- eslint public_html/wp-content/mu-plugins/wporg-groups-frontend/tests-js/group-membership.test.js.

@bor0 bor0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thank you!

@bor0
bor0 merged commit 2febf9f into WordPress:production Aug 10, 2026
6 checks passed
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.

2 participants