"""Auth flow tests — /register, /login (only when use_auth=yes)."""

from __future__ import annotations

import pytest


@pytest.mark.skip(reason="requires DB fixture; wire up after issue #2 (project-status compat)")
async def test_register(client) -> None:
    """POST /api/v1/auth/register creates a user."""
    response = await client.post(
        "/api/v1/auth/register",
        json={"username": "newuser", "email": "new@test.local", "password": "password123"},
    )
    assert response.status_code == 201


@pytest.mark.skip(reason="requires DB fixture; wire up after issue #2 (project-status compat)")
async def test_login_returns_token(client) -> None:
    """POST /api/v1/auth/login returns a JWT."""
    response = await client.post(
        "/api/v1/auth/login",
        json={"username": "tester", "password": "password123"},
    )
    assert response.status_code == 200
    assert "access_token" in response.json()