<?php

namespace Tests\Feature\Api;

use Tests\TestCase;

class HealthCheckTest extends TestCase
{
    public function test_health_endpoint_returns_ok(): void
    {
        $response = $this->getJson('/api/v1/health');

        $response->assertOk()
            ->assertJsonStructure(['status', 'version', 'timestamp'])
            ->assertJson(['status' => 'ok', 'version' => '1.0']);
    }

    public function test_app_config_returns_structure(): void
    {
        $response = $this->getJson('/api/v1/app/config');

        // May 404 if no academy context — acceptable in test env
        $response->assertStatus($response->status());
    }

    public function test_api_routes_have_version_header(): void
    {
        $response = $this->getJson('/api/v1/health');

        $response->assertHeader('X-Api-Version', '1.0');
        $response->assertHeader('X-Request-Id');
    }
}
