<?php

namespace Tests\Feature\V3\Rahdaran;

use App\Models\Rahdaran;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Foundation\Testing\WithFaker;
use Tests\TestCase;

class ListTest extends TestCase
{
    use RefreshDatabase, WithFaker;
    /**
     * A basic feature test example.
     */
    public function test_machine_code_list_return_successfully(): void
    {
        $user = User::factory()->create();

        Rahdaran::factory(5)->create();

        $response = $this->actingAs($user)->getJson(route('v3.rahdaran.list'));

        $response->assertOk();

        $response->assertJsonStructure([
            'data' => [
                '*' => [
                    "name",
                    "code",
                ],
            ]
        ]);
    }
}
