Contributing

Testing contributions

Edit page
Verify feature contracts, authorization, locales, migrations, UI behavior, and layer portability before review.

Testing a Customer Portal contribution means checking its layer boundary as well as its happy path. A feature that works only for one role, one organization, or while tightly coupled to the host is not complete.

Project checks

Run the source-level feature tests first, then the full application checks:

Terminal
pnpm test:features
pnpm validate:feature-locales
pnpm lint
pnpm typecheck
pnpm build

test:features runs the tests owned by layers. validate:feature-locales focuses on the current business features and verifies their locale and contract conventions.

Authorization matrix

For each protected server operation, cover at least:

ContextExpected result
No sessionRejected
Member without the actionRejected
Owner or organization administrator with the actionAllowed
Correct user, wrong active organizationRejected or empty, never leaked
System administratorMatches the documented platform bypass

Client-side visibility is a separate UI test; it never replaces handler-level authorization.

Data and migrations

When a contribution changes a schema:

  1. Generate and review the root migration.
  2. Apply it to an empty database.
  3. Apply it to representative pre-change data.
  4. Verify every feature-owned table and enum uses the feature schema.
  5. Exercise deletion behavior and cross-schema references.
  6. Confirm tenant-owned queries always include the active organization.

Feature contract

Test that registered IDs are stable and unique, audiences match the intended roles, module route prefixes activate the right menu, widgets occupy the intended area and size, and every policy action is mapped deliberately.

Keep English and Dutch key structures identical. Render important states in both locales, including empty, loading, validation, error, and destructive-confirmation states.

Portability

Build the assembled portal with the layer enabled. Also exclude the layer from a copy of the application and verify that the host still typechecks and builds. Feature removal must not leave imports, navigation entries, widget registrations, locale dependencies, or server references behind.

Use service requests as the compact testing reference and review tenancy and security before changing protected data access.