Files
Convivo/docs/backend/tests.md
T
d3083b7940 fix(points): welcome check-in awards +10; add Sessions view, AI connection test, silent reload
The front-desk check-in set checked_in and printed badges but awarded nothing,
so the +10 depended on which check-in a person happened to get. Every award
path was reviewed:

- welcome_checkin awards +10 (category checkin) on a genuine first check-in and
  returns points + points_awarded; checkin_attendee and preview_welcome_checkin
  return points_awarded too.
- set_registration_checked_in(false) deleted all checkin points while keeping
  the checkins rows, and switching back on awarded nothing -- one mistaken
  toggle destroyed those points permanently. ON now recomputes from the rows
  that still exist and awards only the shortfall: reversible, still unfarmable.
- The staff/Admin/@appe.at exclusion stays (product decision) but is no longer
  silent: three-way points sheets in the scanner, "no points" with a tooltip in
  Registrations, and the Contacts points modal refuses to apply rather than
  letting adjust_points (void) no-op quietly.

Also in this change:
- admin silent refresh (5s poll + 500ms after writes) across all data views;
  Registrations patches in place so rows never slide under the cursor
- Settings "Validate AI connection" via a new sidecar POST /llm-test verdict
  endpoint (never leaks the key, distinguishes "no usage block" from "off")
- new Sessions view between Schedule and Activity: speakers, attendance,
  ratings, attendee filter, and one button that summarises every session with
  feedback (one request each, concurrency 3, UI blocked until all settle)
- provider requests disable thinking through one shared body builder sending
  both reasoning_effort:"none" and chat_template_kwargs.enable_thinking

SQL: 113 / 57 / 24 assertions (set_registration_checked_in section 3 was
rewritten, it asserted the bug). Sidecar 34 unit tests. Full e2e 202 passed,
0 failed. Migration applied locally only -- not deployed.

Co-authored-by: Stephan Charles <[email protected]>
Co-authored-by: Amelia Hernandez <[email protected]>
Co-authored-by: Markus Franz <[email protected]>
Co-authored-by: Sabrina Hota <[email protected]>
Co-authored-by: Nilüfer Doğan <[email protected]>
2026-10-19 20:14:03 +02:00

32 KiB

Front-Desk Gate + Badge Copies Regression

After applying 20261019110000_front_desk_gate_and_badge_copies.sql, run the SQL suite combined with the migration in one transaction (the migration is create or replace, so the same stream also re-verifies an already-applied database):

docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
  -v ON_ERROR_STOP=1 < supabase/tests/badge_print_tests.sql
docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
  -v ON_ERROR_STOP=1 < supabase/tests/set_registration_checked_in_tests.sql
CONVIVO_BASE_URL=http://127.0.0.1:3000 npm test --prefix e2e -- front-desk-gate.spec.ts --project=chromium
CONVIVO_BASE_URL=http://127.0.0.1:3000 npm test --prefix e2e -- welcome-badge-copies.spec.ts --project=chromium
CONVIVO_ADMIN_URL=http://127.0.0.1:3001 npm test --prefix e2e -- registration-checkin-toggle.spec.ts --project=chromium

Replaying an older migration is no longer possible for these functions. 20261019160000_welcome_points_and_toggle_restore.sql drops and re-creates checkin_attendee, welcome_checkin, set_registration_checked_in and preview_welcome_checkin with wider return types, and Postgres refuses create or replace across a row-type change. So cat-ing the 20261019110000 migration onto the suite now fails with cannot change return type of existing function … Use DROP FUNCTION checkin_attendee(uuid,text) first — that error is the guard working, not a broken suite. Run the suite against the live database (as above), or chain the newest migration instead:

(echo 'begin;'; \
 cat supabase/migrations/20261019160000_welcome_points_and_toggle_restore.sql; \
 sed '/^begin;$/d' supabase/tests/badge_print_tests.sql) \
  | docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres -v ON_ERROR_STOP=1

That chain still reports 113 assertions.

The SQL fixture is rollback-only: 113 assertions — six of them added with the gate and the copies (the badge-print suite owns both functions) — cover the gate refusing a session check-in for an attendee with no front-desk check-in (session check-in requires a front-desk check-in), the copies loop (badge_copies = 3 queues three more labels) and the savepoint that returns the queue to one so the rest of the run is unaffected, plus preview_welcome_checkin's new copies column: 1 by default, 0 when nothing would print, 3 after the event is changed. The pre-existing "session check-in records / enqueues nothing" case now flips checked_in on first, because the gate makes it a precondition. set_registration_checked_in_tests.sql (24 assertions, was 15) covers the admin toggle that grants and revokes the same flag, with its points accounting — see Points Correctness Regression for what the extra nine assert.

front-desk-gate.spec.ts and welcome-badge-copies.spec.ts are real-browser suites against the local stack (real Auth + PostgREST + pgmq): they provision a disposable attendee, assert the scanner shows its "Not checked in yet" sheet while recording no check-in, that a session check-in no longer sets the front-desk flag by itself, that the same scan succeeds once the welcome check-in is done, that the queue grows by exactly badge_copies messages, and that a re-welcome prints nothing. They delete their own rows and restore badge_copies = 1. registration-checkin-toggle.spec.ts is API-mocked and covers the table behaviour the old build got wrong: no refetch on a toggle or a type change, row order preserved, only the touched row busy while its checkbox is disabled, other rows still usable, rollback on a rejected RPC, and the Settings copies picker saving and reloading.

See release record for the bug this started with.

Points Correctness Regression

After applying 20261019160000_welcome_points_and_toggle_restore.sql:

docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
  -v ON_ERROR_STOP=1 < supabase/tests/leaderboard_tests.sql          # 57 assertions
docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
  -v ON_ERROR_STOP=1 < supabase/tests/set_registration_checked_in_tests.sql   # 24
docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
  -v ON_ERROR_STOP=1 < supabase/tests/badge_print_tests.sql          # 113
CONVIVO_BASE_URL=http://127.0.0.1:3000 npm test --prefix e2e -- checkin-points.spec.ts --project=chromium
CONVIVO_ADMIN_URL=http://127.0.0.1:3001 npm test --prefix e2e -- registration-checkin-toggle.spec.ts sessions-view.spec.ts --project=chromium

leaderboard_tests.sql grew from 47 to 57 assertions: the front-desk (welcome) check-in now awards +10 like a session scan, so it asserts the first welcome pays out and lands on the registration, a second welcome pays nothing, welcome-then-session totals 20, and — for each excluded identity (staff pass, Admin contact, @appe.at) — that a welcome still checks the person in while awarding nothing (points_awarded = false, points = 0). The excluded-identity loop ends on a non-admin JWT, so the suite restores the admin claims afterwards; without that the tail assertions silently run as the wrong person.

set_registration_checked_in_tests.sql grew from 15 to 24 assertions, and its third section was rewritten because it encoded the bug: it used to assert "points unchanged after re-check-in". It now seeds two real checkins rows and asserts the toggle ON re-awards exactly what those rows justify (30), that a second ON adds 0, that an off→on round trip restores 30 both times, and that a staff contact's toggle removes 0 and adds 0.

checkin-points.spec.ts is the end-to-end proof against the real database, which is what the original complaint needed (the scanner appeared not to award the +10):

  • CONV-PTS-001 the welcome check-in pays +10, the confirm sheet promises it before the write, the result sheet says +10 pts · now 10, the registration reads 10, and points_log holds a checkin=10 row.
  • CONV-PTS-002 a second welcome says "No extra points" and stays at 10; the following session scan takes the total to 20.
  • CONV-PTS-003 a staff pass still checks in, but the sheets say "does not earn points" / "staff earn no points", the score stays 0 and no points_log row is written — the exclusion, made visible.
  • CONV-PTS-004 drives set_registration_checked_in through the real RPC (psql has to supply request.jwt.claims because is_admin() reads auth.jwt()): off removes 20, on restores 20, and a third click adds 0 — no farming.

sessions-view.spec.ts (8 tests) covers the new Sessions view against mocked APIs: nav order Schedule → Sessions → Activity, per-session speaker chips and check-in counts, the attendee filter narrowing to that person's sessions and highlighting them in the roster, one request per session that has feedback (none for a session without any), the blocking overlay with its done / total counter and disabled controls, a partial failure reporting which session failed while the others still land, the stale-summary flag, and the disabled button when the LLM is unconfigured or nothing has feedback.

Badge Print Queue Regression

After applying 20261018170000_badge_print_queue, run the SQL suite combined with the migration in one transaction (the migration is idempotent, so the same stream also re-verifies an already-applied database):

(echo 'begin;'; \
 cat supabase/migrations/20261018170000_badge_print_queue.sql; \
 sed '/^begin;$/d' supabase/tests/badge_print_tests.sql) \
  | docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres -v ON_ERROR_STOP=1
CONVIVO_ADMIN_URL=http://127.0.0.1:3001 npm test --prefix e2e -- printing.spec.ts --project=chromium
pytest apps/printer/tests   # worker unit tests (no hardware, no browser)

The SQL fixture is rollback-only: 113 assertions (six of them the front-desk gate and badge copies, covered in the section above) cover queue creation and migration idempotency, pgmq/API isolation, the self-contained payload shape and layout resolution (default-with-elements, fallback, none → no job), first-scan enqueue inside welcome_checkin (re-scan enqueues nothing), station token lifecycle (create shows the token once, only the SHA-256 digest is stored, rename, revoke → 28000), claim/complete/fail semantics (visibility timeout, retry backoff, dead-letter after 3 reads, requeue/discard), the heartbeat (status cap, name echo) and admin/non-admin/anon authorization. The browser suite is API-mocked and covers the always-visible printer pill (ready / error / offline / mobile, click navigates), the offline Wi-Fi setup hint, add-station token-shown-once, inline rename, dead-letter Requeue/Discard, completed-job Reprint, the Registrations Print button (queue + toast, offline still queues, no-layout disabled state) and the 5 s overview polling. The pytest suite covers label composition (die-cut, endless, auto-rotate, LayoutTooLarge), the worker loop (job outcomes, sticky complete, paused printer), the RPC client error mapping, status mapping and the network-state reader. No real printer, Pi or attendee data is involved.

See printing.md for the feature reference and the release record for results.

Badge Editor Regression

After applying 20261015194531_badge_editor, run:

docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
  -v ON_ERROR_STOP=1 < supabase/tests/badge_layout_tests.sql
CONVIVO_ADMIN_URL=http://127.0.0.1:3001 npm test --prefix e2e -- badge-editor.spec.ts --project=chromium

The SQL fixture is rollback-only: fifteen assertions cover creating a default layout, upserting the same (event_id, name) in place, the one-default-per-event invariant when a new default is saved, per-event scoping, set_default promote/demote, refusing to delete the default while other layouts exist, deleting a non-default layout, rejecting blank names, and admin/non-admin/anon authorization (the non-admin read check runs as the real authenticated role so RLS is enforced). The browser suite is API-mocked and covers loading the default layout onto the millimetre canvas with a bound attendee name, adding/selecting a text element and its handles, editing x to move an element, saving via save_badge_layout, preview mode hiding the handles, the JSON view, a failed save, the mobile layout, the Delete key removing the selection, binding the company / organizer field, align-centre on the page, Shift-click multi-select for group alignment, drag-to-centre smart guides with snapping, the labelled Align text in box section (its horizontal / vertical buttons change the rendered text alignment and persist through save and reload), and the Ctrl+Z / Ctrl+Y undo / redo shortcuts (ignored while a panel field has focus). No real attendee data changes.

See RPC rules and the Badges view.

Registration Badge Preview Regression

No migration is involved — the preview reuses the badge layouts above. Run:

CONVIVO_ADMIN_URL=http://127.0.0.1:3001 npm test --prefix e2e -- registration-badge-preview.spec.ts --project=chromium

The suite is API-mocked and covers a Badge button on every registration row, rendering the default layout with that row's own name / ticket type / company and a real QR SVG, per-attendee isolation (one row never shows another's data), switching layouts inside the modal, hiding the picker when only one layout exists, the disabled (grayed-out) Badge button when the event has no layout or only an empty one, the hover tooltip explaining a badge must be configured first (portalled to document.body, so the table never clips it), a failed layout load leaving the buttons disabled without breaking the list, layouts loading once per event (reused by every preview, no per-open request), closing via Done and the backdrop, and fitting a mobile viewport. No real attendee data changes.

Table Filters Regression

No migration is involved — column filters and search are frontend-only. Run:

CONVIVO_ADMIN_URL=http://127.0.0.1:3001 npm test --prefix e2e -- table-filters.spec.ts --project=chromium

The suite is API-mocked and covers the Contacts and Registrations views: the general search matching first name / last name / email (plus type on Registrations), the per-column multi-select filters (Contacts: LinkedIn, Visibility, Admin; Registrations: Type, Ticket, Checked in), filters combining with each other and the search, live option counts that follow the other active filters (Excel-style), the active-count badge on a filter button, Clear, and that the dropdown is portalled to document.body so the table's overflow: hidden never clips it. No real data changes.

Raffle Regression

After applying 20261015180640_raffle, run:

docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
  -v ON_ERROR_STOP=1 < supabase/tests/raffle_tests.sql
CONVIVO_ADMIN_URL=http://127.0.0.1:3001 npm test --prefix e2e -- raffle.spec.ts --project=chromium

The SQL fixture is rollback-only: fifteen assertions cover the eligible pool (excluding staff, Admin, the @appe.at domain and the leaderboard top 3), sequential draw numbers, drawn attendees leaving the pool, the empty-pool over-draw error, winner persistence, run reset, and admin/non-admin/anon authorization. The browser suite is API-mocked and covers the default five picks, the decelerating roulette landing on a winner, drawing until the pick count, retry after a failed draw, starting a new run, a configurable pick count, and the mobile layout. No real LLM, email or points change is involved.

See RPC rules and the Raffle view.

Leaderboard Regression

After applying 20261015164546_leaderboard_staff_admin_exclusion, run:

docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
  -v ON_ERROR_STOP=1 < supabase/tests/leaderboard_tests.sql
CONVIVO_BASE_URL=http://127.0.0.1:3000 npm test --prefix e2e -- leaderboard-live.spec.ts --project=chromium

The SQL fixture rolls back and checks scoring, idempotency, event isolation, staff/Admin zero balances, role changes, deterministic ranking, API-role grants and Realtime publication membership. The browser test is local-only and uses real Auth, PostgREST and WebSockets, not mocked APIs. It creates disposable accounts, verifies live score/rank changes and staff/Admin exclusions, then deletes its fixtures. It requires the local attendee app, Supabase and an active event.

See October 15 validation for results and scope.

Feedback AI Summary Regression

After applying only 20261011163332_feedback_ai_summaries, run:

npm test --prefix apps/sidecar
docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
  -v ON_ERROR_STOP=1 < supabase/tests/feedback_ai_summary_tests.sql
CONVIVO_ADMIN_URL=http://127.0.0.1:3001 npm test --prefix e2e -- feedback-ai-summary.spec.ts --project=chromium

The SQL fixture is rollback-only: eight assertions cover RLS, grants, deprecated stub permissions, service-role persistence, admin/non-admin reads and cascades. Unit tests cover provider payload privacy, settings-key redaction and retention, scope isolation, empty feedback, errors, duplicate requests and private-address rejection and multi-page snapshots. Eight API-mocked browser tests cover settings, manual event/session generation, restored summaries, disabled states, pagination, retry and desktop/mobile layouts. These tests do not send real feedback to any LLM or send login emails.

See Feedback AI summaries for the request/response contract and local-only activation status.

Service Staff Regression

The attendee browser suite also covers demo clock dates for two different events and real-time mode against a fixed system date:

CONVIVO_BASE_URL=https://convivo.appe.at npm test --prefix e2e -- convivo-admin-entry.spec.ts --project=chromium --grep 'Event demo clock'

These three checks fail if the demo clock falls back to the seed date. They assert Done/Live/Up next at 10:20 on the event start date, and all Done for a later real system date with real-time mode enabled.

GridSmart source and automatic-poll regressions:

npm test --prefix apps/sidecar
docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
  -v ON_ERROR_STOP=1 < supabase/tests/gridsmart_sync_tests.sql
CONVIVO_ADMIN_URL=https://admin.appe.at npm test --prefix e2e -- sessionize-source.spec.ts --project=chromium

Apply 20261011060534_gridsmart_service_identity first. Seven rollback SQL assertions cover manual service ID adoption, concurrent placeholder types, staff assignment, omitted talks/metadata/speakers and repeat-poll idempotence. Sidecar tests include five source-reader checks, two polling checks and the existing nine Excel checks. Browser tests cover both input formats and invalid host rejection without script execution. Actual live startup polling and a second no-duplicate sync were also verified.

After applying 20261011054613_service_session_staff_assignment, run:

docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
  -v ON_ERROR_STOP=1 < supabase/tests/service_session_staff_tests.sql
CONVIVO_BASE_URL=https://convivo.appe.at npm test --prefix e2e -- convivo-admin-entry.spec.ts --project=chromium --grep 'Service agenda'

The SQL fixture rolls back and covers staff present before session creation, later staff promotion, unchanged talk speakers, event isolation and idempotence. Browser fixtures cover service ordering and staff names on mobile and desktop, including active talk filters. They also cover Placeholder nesting within matching talk blocks, corrected displayed block counts, filter-independent visibility and retained no-pick/no-upload service behavior even for an assigned staff speaker. A separate case checks exact date/time matching and keeps unrelated services separate. See the deployment record.

Agenda Consistency + Home Picks Regression

Further API-mocked checks run in the same spec:

CONVIVO_BASE_URL=http://127.0.0.1:3000 npm test --prefix e2e -- convivo-admin-entry.spec.ts --project=chromium --grep 'Service agenda|Home session picks'
  • Orphan service slot — a get_agenda row whose slot is a service_session with a null session (the LEFT JOIN shape a slot with no session row produces) must render no card at all, so every service card consistently shows a header plus its session row. The rule lives in groupAgenda, so the list, the displayed slot count and Home's Now/Next all agree.
  • Home session picks — tapping a "My picks today" chip opens the shared SessionDetail sheet over Home (title, description, time/room/speaker, level pill, and the "Remove my pick" control) and leaves the active tab on Home; closing the sheet returns to the pick list. This replaces the old behavior of routing to the Agenda tab.
  • Pick nudge suppression — with a pick on the other slot, the Now card's concurrent list must not show "No pick yet — tap a session in the Agenda to choose."; with no picks at all the nudge is still shown. Asserted per card (.now-card), since Now and Next each render their own copy.
  • Service session feedback suppression — a staff contact who is an assigned speaker of a finished service slot opens its sheet and must see no "Your session feedback" block, no give-feedback button and no "You weren't checked in" note (the sheet still shows the title and "No pick needed for this slot.").
  • Multi-line description — a get_agenda description containing \n\n renders in #sd-desc with white-space: pre-line; the raw newlines stay in the DOM and the block measures taller than the same text with collapsed whitespace.
  • No demo-clock badge — each "Event demo clock" scenario also opens Home and asserts "Demo clock" is absent, in both simulated and real-time mode.

The last three cases come from the 2026-10-18 feedback polish; see the release record.

Session Persistence Regression

Run the rollback-only fixture after applying 20261010183614_preserve_sessions_on_unchanged_ticket:

docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres \
  -v ON_ERROR_STOP=1 < supabase/tests/session_persistence_tests.sql

It verifies unchanged repeated imports preserve the existing password hash and session, changed ticket passwords revoke sessions, and admin password precedence survives ticket changes. No fixture accounts remain after rollback.

The production Auth policy was additionally verified with a disposable confirmed test account: actual refresh succeeded at six days, failed after the seven-day lifetime, and failed after eight-day inactivity. Cleanup removed the test account; no real email was sent. See release record.

Backend — RPC Test Suite

A self-contained, idempotent test suite for the transactional points RPCs, role guards, and the speaker auto-promote trigger. It runs directly against the local Supabase Postgres container.

Run it

Assigned-speaker/Pretix role regression tests (rollback-only):

{ printf 'BEGIN;\n'; cat supabase/migrations/20261009225632_guard_sessionize_dates.sql supabase/migrations/20261010102828_registration_ticket_merge.sql supabase/migrations/20261010111607_preserve_assigned_speaker_role.sql supabase/tests/assigned_speaker_role_tests.sql; } | docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres -v ON_ERROR_STOP=1

Covers purchased attendee tickets becoming assigned speakers, assignment before ticket creation, repeated Pretix updates, Excel/Pretix replay, assignment updates, staff/sponsor precedence, service-session exclusion and other-event isolation. QR, ticket ID, check-in and points are preserved.

Ticket merge regression tests (rollback-only, including prior date-guard functions when the local database has not installed that migration):

{ printf 'BEGIN;\n'; cat supabase/migrations/20261009225632_guard_sessionize_dates.sql supabase/migrations/20261010102828_registration_ticket_merge.sql supabase/tests/registration_ticket_merge_tests.sql; } | docker exec -i supabase_db_Convivo psql -X -U postgres -d postgres -v ON_ERROR_STOP=1
CONVIVO_ADMIN_URL=http://127.0.0.1:3001 npm test --prefix e2e -- registration-ticket-merge.spec.ts --project=chromium

Coverage includes ticket-only totals, authorization, cross-event isolation, last-speaker-safe transfers, duplicate assignments, staff precedence, retained ticket points/QR/check-in, source activity rejection, import provenance and Excel/API replay. Browser tests cover immediate check-in feedback and failure rollback, imported-only merge buttons, suggestions, manual choice, cancel/retry.

npm run db:start     # the Supabase core must be running
npm run test:rpc     # runs supabase/tests/rpc_tests.sql, exits non-zero on failure

Or manually:

docker exec -i supabase_db_Convivo psql -U postgres < supabase/tests/rpc_tests.sql

How it works

  • No seed mutation. Everything runs in a single transaction that rolls back at the end, so the seed data is never changed. Safe to run repeatedly.
  • Current user = PostgREST-style JWT claim. Each test sets the user the same way PostgREST does: set_config('request.jwt.claims', '{"email":"..."}', false), which is what public.current_email() and public.is_admin() read.
  • Every test always runs. Each test is a DO block that catches its own exceptions and records a pass/fail row into a temp table, so one failure never aborts the rest. A summary is printed before the rollback.
  • The runner fails the process (npm run test:rpc) if any test failed, so it can be wired into CI.

What it covers

Area Tests
checkin_attendee awards +10, marks checked_in, idempotent re-check-in, service-session guard, non-admin role guard
submit_feedback +5 rating-only, idempotent re-submit, requires check-in
accept_connection +5 to both parties
adjust_points admin-only role guard
Speaker auto-promote trigger attendee → speaker, never overrides staff
Leaderboard excludes staff

Speaker Portal

speaker_portal_tests.sql is an independent fail-fast suite (ON_ERROR_STOP) with generated contacts/events/talks, temporary snapshots and a single transaction ending in ROLLBACK. It needs the speaker portal migration and staff overlap migration on the local database. Apply without resetting existing data:

docker exec -i supabase_db_Convivo psql -U postgres -d postgres -v ON_ERROR_STOP=1 --single-transaction < supabase/migrations/20261006175631_speaker_portal.sql
docker exec -i supabase_db_Convivo psql -U postgres -d postgres -v ON_ERROR_STOP=1 --single-transaction < supabase/migrations/20261007153957_speaker_portal_staff_overlap.sql
docker exec -i supabase_db_Convivo psql -U postgres -d postgres -v ON_ERROR_STOP=1 < supabase/tests/speaker_portal_tests.sql

This direct migration application reloads the local API schema but does not write CLI migration history. It is not a production deployment command. No database reset is needed; fixture sequence state is not advanced.

The suite checks assigned speaker, non-admin staff and Admin staff access, unassigned staff, mismatched same-event registrations, attendee assignments, unregistered assignments, automatic service-session exclusion, active/inactive past/future events, malformed and cross-session paths, required uploaded objects, Storage INSERT/UPDATE/DELETE (including UPDATE WITH CHECK) and unchanged registration, points-log, check-in and leaderboard state. Storage policy checks use the authenticated database role, not a superuser that bypasses RLS. A failed assertion exits non-zero and connection closure rolls back the transaction.

speaker-portal.spec.ts uses mocked Auth, REST and Storage responses, without real credentials or mail delivery:

cd e2e
CONVIVO_BASE_URL=http://127.0.0.1:3000 npx playwright test tests/speaker-portal.spec.ts --project=chromium --reporter=list --output=/tmp/convivo-speaker-results

Start Convivo's dev server first. Coverage includes both routes, existing-users-only link requests, URL scrubbing, callback errors/rejections, StrictMode single-use implicit/PKCE callbacks, local logout, empty access, upload/replace/remove across desktop/mobile, failed attachment cleanup and the normal app's check-in gate after portal login. Mocked tests do not validate live mail delivery, deployment redirect allowlists or real Storage behavior; the SQL suite validates database authorization separately. See screen contract, API client, RLS and RPCs.

Sessionize Date Guard

sessionize_date_guard_tests.sql is an independent fail-fast rollback-only suite for the Sessionize API and Excel RPC date guard. It creates generated event/contact/auth fixtures, precreates explicit negative slot IDs so successful imports do not allocate sequence values, and ends with ROLLBACK.

To verify the migration and suite together on the local database without persisting either change:

{ printf 'BEGIN;\n'; cat supabase/migrations/20261009225632_guard_sessionize_dates.sql supabase/tests/sessionize_date_guard_tests.sql; printf '\nROLLBACK;\n'; } | docker exec -i supabase_db_Convivo psql -U postgres -d postgres -v ON_ERROR_STOP=1

The nested BEGIN warning from the suite is harmless in this rollback-only check. This command is local validation only; it does not write CLI migration history and is not a production deployment. Historical rows outside the newly configured event range are retained by successful imports and need a separately approved reconciliation if they should be removed or changed.

Delete Event Schedule

delete_event_schedule_tests.sql is an independent fail-fast rollback-only suite for the admin schedule-clear RPC. It creates generated contacts/events/auth fixtures, uses explicit negative slot IDs so fixture setup does not advance slots_id_seq, and ends with ROLLBACK.

To verify the migration and suite together on the local database without persisting either change:

{ printf 'BEGIN;\n'; cat supabase/migrations/20261009231817_delete_event_schedule.sql supabase/tests/delete_event_schedule_tests.sql; printf '\nROLLBACK;\n'; } | docker exec -i supabase_db_Convivo psql -U postgres -d postgres -v ON_ERROR_STOP=1

The suite checks authenticated admin execution, non-admin rejection, anon execute denial, missing-event rejection, exact delete counts, unchanged event selection, registrations, contacts, auth users, sponsors, connections, points, event feedback, leaderboard and other-event schedule rows. It also proves cross-event slot/dependent mismatches fail atomically instead of cascading foreign-event rows. This is local validation only; it does not write migration history or deploy anything.

Sessionize Excel Transform

The sidecar's Excel transform tests use Node's built-in test runner and the installed xlsx dependency. They generate synthetic workbooks in memory, without real personal data, server startup, HTTP calls, or database access:

npm test --prefix apps/sidecar
node --check apps/sidecar/src/transform-excel.js
node --check apps/sidecar/src/server.js

Coverage includes the localized topic header, trimmed/case-insensitive header matching, nonempty Area/Topic fallback, complete comma-separated topic strings, flattened multi-speaker session grouping, duplicate speaker IDs/emails, singular Speaker Id fallback, legacy two-sheet plural Speaker Ids, scheduled time and metadata preservation, service-session classification, and unscheduled-row filtering. Generated XLSX service regressions also cover an explicit service sheet alongside flattened talks, a service-only workbook, missing-ID service classification, duplicate service rows, stable generated IDs across repeated parses and row reordering, unchanged IDs after duration/description edits, distinct identities by title/room/date/start, preservation of explicit source IDs, and exclusion of untitled, invalid-time and ID-less talk rows. See service export limitations and accepted service format.

Read-only validation of the supplied 2026-10-09 workbook compared its complete parsed payload against the committed parser: unchanged 21 sessions, 24 speakers, 21 speaker links and zero service sessions. Parsing twice produced identical payloads. No HTTP import or database writes were performed. Parser repeatability and the existing RPC external-ID upsert contract support idempotent imports; these database-free checks do not verify a live import or prove that any configured API endpoint includes the services missing from Excel.

Files