auth0-testslisted
Install: claude install-skill testland/qa
# auth0-tests
## Overview
Tests against an Auth0 tenant fall into three layers:
1. **Tenant-level config** - connections, clients, APIs, tenants
themselves; tested via Auth0 Deploy CLI for env parity.
2. **Auth flow** - tested by exercising the OIDC endpoints from
the application against a dev tenant.
3. **Custom serverless code** - Actions (current), Rules + Hooks
(legacy); unit-tested in Node.js with the Auth0 SDK mocks.
## When to use
- The repo uses Auth0 as IdP.
- The team has multiple environments (dev / staging / prod) needing
config parity.
- Custom Actions / Rules need unit-test coverage.
- Auth flow regression suites need to run pre-deploy.
## How to use
1. Pick a tenant strategy (Step 1): per-PR tenant for tenant-config
tests, mocked OIDC for fast app-side flow tests.
2. Export the source tenant with `a0deploy` and commit the YAML as
fixtures for the config-drift check (Step 2).
3. Exercise the OIDC token endpoint for the grants the app uses -
client-credentials for M2M, Universal Login via Playwright for
interactive flows (Step 3).
4. Unit-test each Action handler by calling `onExecutePostLogin`
with a stub `api` and asserting on `api.access.deny` (Step 4);
apply the legacy callback signature for surviving Rules / Hooks
(Step 5).
5. Cover session behavior - refresh-token rotation plus the
nine-point checklist (Step 6).
6. Wire the unit run and the `a0deploy` config-drift diff into CI
(Step 8).
## Step 1 - Tenant strate