Skip to content

test: cover REST operations edge cases - #307

Open
erseco wants to merge 2 commits into
mainfrom
test/rest-ops-edge-cases
Open

test: cover REST operations edge cases#307
erseco wants to merge 2 commits into
mainfrom
test/rest-ops-edge-cases

Conversation

@erseco

@erseco erseco commented Jul 30, 2026

Copy link
Copy Markdown
Member

Summary

  • add integration coverage for missing assignment/removal parameters returning 400
  • verify non-task posts are rejected with 404 and remain untouched
  • cover normalization of scalar legacy assigned_users metadata
  • verify duplicate assignments are idempotent, emit no duplicate hook, and do not rotate the edit generation
  • verify no-op removals preserve assignment state and the active generation
  • verify real removals preserve remaining assignees and invalidate open editing sessions
  • verify due-date requests without a value are no-ops
  • verify due-date values are sanitized, persisted, and invalidate stale sessions

Why

The REST operations controller was recently extracted from Decker_Tasks. Existing tests cover route registration and the main mutation flows, but not the error responses, legacy metadata shapes, and idempotent/no-op behavior. These cases are important because unnecessary generation rotation interrupts active editors, while missed rotation can allow stale forms to overwrite out-of-band changes.

Test plan

CI should run the complete PHPUnit, lint, Plugin Check, PHPMD, JavaScript, and E2E suites. This PR only adds integration tests and does not change production behavior.

@github-actions

Copy link
Copy Markdown

WordPress Playground Preview

The changes in this pull request can previewed and tested using a WordPress Playground instance.

Open WordPress Playground Preview

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