Skip to content

Add platform role and permission service tests #64

Description

@pragmaticAweds

Context

The platform role/permission controllers contain important authorization setup logic: duplicate permission detection, role creation, permission validation, role editing, and delete constraints. There are currently no focused tests under src/__tests__ for these paths.

Scope

  • Add tests for adding permissions and rejecting duplicates
  • Add tests for deleting permissions that do and do not belong to roles
  • Add tests for role creation with valid, missing, duplicate, and invalid permissions
  • Add tests for role editing and deleting non-super-admin roles
  • Verify expected ConflictError, NotFoundError, BadRequestError, and InvalidRequestError behavior
  • Cover permission transformation utilities where controller tests are too heavy

Out of Scope

  • Changing the platform permissions model
  • Adding new platform endpoints
  • UI/admin dashboard work

Acceptance Criteria

  • Platform role/permission behavior has regression tests
  • Error cases return or throw the expected project error types
  • Tests do not require a live database
  • bun run type-check passes
  • bun run test passes
  • bun run lint passes

Suggested Files or Packages

  • src/components/v1/platform/
  • src/components/v1/platform/platformControllers/permission.controller.ts
  • src/components/v1/platform/platform.utils.ts
  • src/__tests__/

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions