test(app): authenticated shell suite on the isolated stack

pnpm e2e:shell (db-sandbox e2e-shell) builds a Vite server on 127.0.0.1:5192 against a Supabase URL that resolves nowhere and replays its calls on the sandbox. Per-test fictitious accounts through the admin API, a clean avatar seeded: sign-in, dashboard, the photo confirmation with a slow removal, the phone drawer, FR and EN, axe. No trace kept, fixture values masked in reports.
This commit is contained in:
bchanot committed 2026-10-25 22:46:19 +01:00
1 parent 8371aa0a2a
commit e3a2b3e114
7 files changed
+395 -19

No files matched your search

+13 -7
View File
@@ -11,6 +11,7 @@
# pnpm db:sandbox test-db the pgTAP files (`supabase test db`)
# pnpm db:sandbox types [--check] generated types (write, or diff with the committed file)
# pnpm db:sandbox test packages/supabase/tests/sandbox (HTTP, concurrency)
# pnpm db:sandbox e2e-shell = pnpm e2e:shell: the /app shell in Chromium (apps/app/e2e)
# pnpm db:sandbox sql psql as postgres on stdin
# pnpm db:sandbox down
#
@@ -213,6 +214,15 @@ cmd_down() {
echo "== sandbox removed"
}
# A test runner gets the endpoints and keys through its environment, never argv.
with_sandbox_env() (
export SANDBOX_DB_CONTAINER="$DB" SANDBOX_PG_PASSWORD="$SB_PW"
export SANDBOX_AUTH_URL="http://127.0.0.1:$PORT_AUTH" SANDBOX_REST_URL="http://127.0.0.1:$PORT_REST"
export SANDBOX_STORAGE_URL="http://127.0.0.1:$PORT_STORAGE" SANDBOX_MAIL_URL="http://127.0.0.1:$PORT_MAIL"
export SANDBOX_ANON_KEY="$SB_ANON_KEY" SANDBOX_SERVICE_KEY="$SB_SERVICE_KEY"
"$@"
)
case "${1:-}" in
up) shift; cmd_up "$@" ;;
down) cmd_down ;;
@@ -225,12 +235,8 @@ case "${1:-}" in
else
printf '%s\n' "$out" > packages/supabase/src/database.types.ts; echo "== types written"
fi ;;
test)
load_secrets
SANDBOX_DB_CONTAINER="$DB" SANDBOX_PG_PASSWORD="$SB_PW" SANDBOX_AUTH_URL="http://127.0.0.1:$PORT_AUTH" \
SANDBOX_REST_URL="http://127.0.0.1:$PORT_REST" SANDBOX_MAIL_URL="http://127.0.0.1:$PORT_MAIL" \
SANDBOX_ANON_KEY="$SB_ANON_KEY" SANDBOX_SERVICE_KEY="$SB_SERVICE_KEY" \
node_modules/.bin/pnpm --filter @faunosteo/supabase test:sandbox ;;
test) load_secrets; with_sandbox_env node_modules/.bin/pnpm --filter @faunosteo/supabase test:sandbox ;;
e2e-shell) load_secrets; with_sandbox_env node_modules/.bin/pnpm --filter @faunosteo/app e2e:shell ;;
sql) load_secrets; sb_psql ;;
*) sed -n '2,23p' "$0"; exit 1 ;;
*) sed -n '2,24p' "$0"; exit 1 ;;
esac