# ts-customer-02-01 — §2 verified path, BRAND-NEW user → S6 paywall.
# Spec ref: requirement/flow_customer.mermaid.md §2, branch
#   OTPok="verified" → UserLookup="no · brand-new" → S6 Paywall.
#
# Verifies the post-OTP intent fix: the user who arrived via the §2
# transaction CTA ("aku mau curhat") is routed by the router redirect to
# /payment/entry → /payment/discount-paywall, NOT /home.
#
# Pre-reqs:
#   - Backend reachable; NODE_ENV != 'production'.
#   - ≥1 mitra online (mitraAvailable gates the "aku mau curhat" CTA).
#   - first_session_discount is enabled in the pricing config (default).
appId: com.halobestie.client.client_app
env:
  TEST_PHONE: "+6281234567890"
  BACKEND_INTERNAL_URL: http://localhost:3001
---
- runScript:
    file: ../scripts/reset_phone.js
    env:
      TEST_PHONE: ${TEST_PHONE}
      BACKEND_INTERNAL_URL: ${BACKEND_INTERNAL_URL}
- launchApp:
    clearState: true
- runFlow: ../subflows/onboarding_new_user_verified.yaml

# Post-OTP: router consumes intent=onboarding → /payment/discount-paywall.
# Brand-new user (no chat_sessions) is eligible for first_session_discount.
- extendedWaitUntil:
    visible:
      text: "(?s).*biar yakin yang mau cerita.*"
    timeout: 20000
- assertVisible: "(?s).*mulai ·.*"
