Files
openhuman/scripts
cc55323025 Fix/202: e2e logout relogin onboarding (#305)
* fix(e2e): add logout/re-login onboarding overlay spec and shared helpers (#202)

- Add isOnboardingOverlayVisible, waitForOnboardingOverlayVisible,
  waitForOnboardingOverlayHidden to shared-flows for precise overlay
  lifecycle assertions across specs.
- Add logoutViaSettings helper: navigates to Settings, clicks Log out,
  handles optional confirmation dialog, asserts logged-out state —
  consolidating logout logic that was duplicated per-spec.
- Add waitForLoggedOutState helper returning the first welcome-screen
  marker found (Welcome / Sign in / Login / Get Started).
- New spec logout-relogin-onboarding.spec.ts verifies:
    1. Fresh login completes onboarding and reaches Home.
    2. Logout clears persisted auth/onboarding state (token + all
       per-user onboarding maps reset to {}).
    3. Re-login with a delayed /telegram/me response does NOT show
       the overlay prematurely (proves no stale userLoadTimedOut leak).
    4. Once the fresh-session timeout elapses the overlay appears with
       clean Welcome + Skip markers and a /telegram/me call is made.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(e2e): add telegramMeDelayMs mock behavior for onboarding timing tests (#202)

- Add getDelayMs/sleep utilities to mock-api-core.mjs so individual
  endpoints can honour a configurable delay set via __admin/behavior.
- Wire telegramMeDelayMs into the GET /telegram/me handler so the
  logout-relogin spec can simulate a slow profile fetch and assert that
  the onboarding overlay does not fire before the timeout threshold.
- Reformat long if-conditions and json() call sites to stay within line
  length limits (no logic changes).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-03 17:30:58 +05:30
..
2026-03-26 17:04:46 -07:00
2026-02-05 19:29:21 +05:30
2026-03-30 17:52:32 -07:00
2026-03-29 10:30:18 -07:00