<?php

namespace Tests\Unit;

use App\Services\AttendanceImportService;
use App\Services\Attendance\AttendanceRecordWriter;
use Tests\TestCase;

class AttendanceImportTemplateTest extends TestCase
{
    public function test_template_sample_row_aligns_with_headers(): void
    {
        $service = app(AttendanceImportService::class);
        $headers = $service->templateHeaders();
        $sample = $service->templateSampleRow();

        $this->assertSame(count($headers), count($sample));
        $this->assertSame([
            'employee_code',
            'attendance_date',
            'check_in_time',
            'check_out_time',
            'attendance_status',
        ], $headers);
        $this->assertContains($sample[4], AttendanceRecordWriter::allowedStatuses());
    }
}
