def test_login_success(client):
    response = client.post("/api/auth/login", json={"username": "admin", "password": "123456"})

    assert response.status_code == 200
    assert response.json() == {
        "token": "fake-jwt-token-for-admin",
        "username": "admin",
    }


def test_login_rejects_invalid_credentials(client):
    response = client.post("/api/auth/login", json={"username": "admin", "password": "wrong"})

    assert response.status_code == 401
    assert response.json()["detail"] == "Invalid credentials"
