# Verifies the online/offline toggle works and reflects in the UI.
# This is independent of the customer side — pure mitra UI test.
#
# Run:
#   maestro test mitra_app/.maestro/flows/02_online_offline_toggle.yaml
appId: ${APP_ID_ANDROID}
---
- launchApp:
    clearState: false

# Find the toggle and capture initial state.
- assertVisible:
    text: "Online|Offline"

# Tap the toggle — it's a Switch widget; Maestro can tap by adjacent text label.
- tapOn:
    text: "Online|Offline"

# After flipping, the opposite label should appear within ~2s
# (status is server-confirmed via /api/mitra/status/online or /offline).
- assertVisible:
    text: "Online|Offline"
    timeout: 5000
