<?php

namespace Tests\Feature\Api;

use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

class DeviceAuthTest extends TestCase
{
    use RefreshDatabase;

    public function test_missing_token_returns_401(): void
    {
        $response = $this->getJson('/api/v1/config');
        $response->assertStatus(401);
        $response->assertJsonPath('error.code', 'unauthenticated');
    }

    public function test_invalid_token_returns_401(): void
    {
        $response = $this->withHeaders(['X-Device-Token' => 'not-a-real-token'])->getJson('/api/v1/config');
        $response->assertStatus(401);
    }
}
