Skip to content

test: add enterprise guard coverage#893

Closed
CleanDev-Fix wants to merge 1 commit into
Disciplr-Org:mainfrom
CleanDev-Fix:codex/enterprise-guard-tests
Closed

test: add enterprise guard coverage#893
CleanDev-Fix wants to merge 1 commit into
Disciplr-Org:mainfrom
CleanDev-Fix:codex/enterprise-guard-tests

Conversation

@CleanDev-Fix

Copy link
Copy Markdown

Summary

Adds dedicated enterpriseGuard feature-gating tests and documents the guard decision matrix.

Changes

  • Add src/tests/enterpriseGuard.test.ts covering auth-before-authz ordering, enterprise allow/deny behavior, fail-closed tier cases, tier downgrade behavior, and orgAuth/RBAC ordering.
  • Update docs/enterprise.md with the expected enterpriseGuard outcomes for missing auth, missing tier, non-enterprise users, valid enterprise users, org membership, and RBAC failures.

Testing/Verification

  • npm test -- src/tests/enterpriseGuard.test.ts
  • npm test -- src/tests/enterpriseGuard.test.ts --coverage --collectCoverageFrom=src/middleware/enterpriseGuard.ts
  • npx eslint src/tests/enterpriseGuard.test.ts src/middleware/enterpriseGuard.ts --max-warnings=0

npm run build was also attempted, but the repository currently has unrelated pre-existing TypeScript errors outside this diff.

Closes #858

@1nonlypiece

Copy link
Copy Markdown
Contributor

appreciate the work, but #858 already has an assignee who isn't you. closing for now — claim an open issue and we'll review that. https://discord.gg/xvNAvMJf

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.

Add enterpriseGuard middleware feature-gating and exposure tests in src/tests/enterpriseGuard.test.ts

2 participants