import pytest


def test_default_portal_url_is_prod(monkeypatch):
    monkeypatch.delenv("ANON_PORTAL_URL", raising=False)
    from gui_v6.app import DEFAULT_PORTAL_URL, resolve_portal_url
    assert DEFAULT_PORTAL_URL == "https://app.aivanov.eu"
    assert resolve_portal_url() == "https://app.aivanov.eu"


def test_portal_url_env_override(monkeypatch):
    monkeypatch.setenv("ANON_PORTAL_URL", "http://localhost:8088")
    from gui_v6.app import resolve_portal_url
    assert resolve_portal_url() == "http://localhost:8088"
