<?php

namespace Tests\Feature\Api\Attendance;

use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Laravel\Sanctum\Sanctum;
use Tests\TestCase;

class TeacherAttendanceApiControllerTest extends TestCase
{
    use RefreshDatabase;

    public function test_teacher_grid_endpoint_returns_success(): void
    {
        $user = User::factory()->create();
        Sanctum::actingAs($user);

        $response = $this->getJson('/api/v1/attendance/teacher/grid');

        $response->assertStatus(200);
    }

    public function test_teacher_form_endpoint_returns_success_or_validation_message(): void
    {
        $user = User::factory()->create();
        Sanctum::actingAs($user);

        $response = $this->getJson('/api/v1/attendance/teacher/form');

        $this->assertContains($response->status(), [200, 422]);
    }
}
