Summary
The admin ban integration tests are currently disabled because they require admin credentials that aren't configured in CI.
Background
The requestLine.spec.js test file includes a test for user banning functionality:
should return 403 when user is banned
This test requires:
AUTH_USERNAME and AUTH_PASSWORD environment variables set for the test runner
- A corresponding admin user with credentials in better-auth
Requirements
To enable these tests, configure the following in .env:
# Default admin user (created by auth service when CREATE_DEFAULT_USER=TRUE)
DEFAULT_USER_EMAIL=testadmin@test.local
DEFAULT_USER_USERNAME=testadmin
DEFAULT_USER_PASSWORD=<secure-password>
DEFAULT_USER_DJ_NAME=Test DJ
DEFAULT_USER_REAL_NAME=Test Admin
DEFAULT_ORG_SLUG=test-org
DEFAULT_ORG_NAME=Test Organization
# Credentials for test runner (should match DEFAULT_USER)
AUTH_USERNAME=testadmin
AUTH_PASSWORD=<secure-password>
Implementation
- Add the required environment variables to
.env
- Update
scripts/ci-test.sh to enable TEST_ADMIN_BAN=true
- Verify admin ban test passes with
npm run ci:testmock:full
Current Workaround
The admin ban test is skipped when TEST_ADMIN_BAN is not set to true. The ci:test:full script currently does not enable this flag.
Files
scripts/ci-test.sh - CI test runner (has TEST_ADMIN_BAN commented out)
scripts/ci-env.sh - CI environment setup (checks for DEFAULT_USER credentials)
tests/integration/requestLine.spec.js - Contains the admin ban test
tests/utils/anonymous_auth.js - Contains banUser, unbanUser, getAdminToken functions
Summary
The admin ban integration tests are currently disabled because they require admin credentials that aren't configured in CI.
Background
The
requestLine.spec.jstest file includes a test for user banning functionality:should return 403 when user is bannedThis test requires:
AUTH_USERNAMEandAUTH_PASSWORDenvironment variables set for the test runnerRequirements
To enable these tests, configure the following in
.env:Implementation
.envscripts/ci-test.shto enableTEST_ADMIN_BAN=truenpm run ci:testmock:fullCurrent Workaround
The admin ban test is skipped when
TEST_ADMIN_BANis not set totrue. Theci:test:fullscript currently does not enable this flag.Files
scripts/ci-test.sh- CI test runner (hasTEST_ADMIN_BANcommented out)scripts/ci-env.sh- CI environment setup (checks for DEFAULT_USER credentials)tests/integration/requestLine.spec.js- Contains the admin ban testtests/utils/anonymous_auth.js- ContainsbanUser,unbanUser,getAdminTokenfunctions