# retoor <retoor@molodetz.nl>

from tests.conftest import BASE_URL


def test_devii_session_as_guest(page, app_server):
    resp = page.request.get(f"{BASE_URL}/devii/session")
    data = resp.json()
    assert data["loggedIn"] is False
    assert data["username"] == "guest"
    assert "enabled" in data
    assert "guestsEnabled" in data
    assert data["baseUrl"] == BASE_URL


def test_devii_session_as_logged_in(alice):
    page, _ = alice
    resp = page.request.get(f"{BASE_URL}/devii/session")
    data = resp.json()
    assert data["loggedIn"] is True
    assert data["username"] == "alice_test"
    assert "enabled" in data
