Skip to content

Unit tests: Add test coverage for ContentPermissionService#22373

Merged
AndyButland merged 3 commits intomainfrom
v17/qa/add-tests-for-content-permission-service
Apr 8, 2026
Merged

Unit tests: Add test coverage for ContentPermissionService#22373
AndyButland merged 3 commits intomainfrom
v17/qa/add-tests-for-content-permission-service

Conversation

@AndyButland
Copy link
Copy Markdown
Contributor

@AndyButland AndyButland commented Apr 8, 2026

Description

Adds unit tests for ContentPermissionService, which was previously not covered by automated tests.

This closes the test coverage gap identified when ContentPermissionsTests (testing the now-obsolete ContentPermissions.CheckPermissions) was removed in #22335.

Testing

Verify all 17 tests pass via the build pipeline.

Copilot AI review requested due to automatic review settings April 8, 2026 06:24
@AndyButland AndyButland changed the title QA: Add unit tests for ContentPermissionService Unit tests: Add test coverage for ContentPermissionService Apr 8, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new unit test suite for ContentPermissionService to restore/extend coverage after removal of the obsolete ContentPermissions.CheckPermissions tests.

Changes:

  • Introduces 17 unit tests covering AuthorizeAccessAsync, AuthorizeRootAccessAsync, AuthorizeBinAccessAsync, and AuthorizeCultureAccessAsync.
  • Adds helpers for constructing users, language access, permissions, and TreeEntityPath test data.

Copy link
Copy Markdown
Contributor

@Migaroez Migaroez left a comment

Choose a reason for hiding this comment

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

Looks like sensible tests, the only comment I have is the use of repeated paths and ids without meaning. Might be a good idea to put them in local consts so that the code is easier to read.

@AndyButland
Copy link
Copy Markdown
Contributor Author

Good idea, I'll make that update before merging.

@AndyButland AndyButland enabled auto-merge (squash) April 8, 2026 12:54
@AndyButland AndyButland merged commit 681a510 into main Apr 8, 2026
26 of 27 checks passed
@AndyButland AndyButland deleted the v17/qa/add-tests-for-content-permission-service branch April 8, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants