<?php

namespace Tests\Unit\Resources\Roles;

use App\Http\Resources\Roles\RoleResource;
use Tests\TestCase;

class RoleResourceTest extends TestCase
{
    public function test_resource_shape(): void
    {
        $resource = new RoleResource([
            'id' => 1,
            'name' => 'admin',
            'slug' => 'admin',
            'description' => 'Admin',
            'dashboard_route' => 'administrator/administratordashboard',
            'priority' => 1,
            'is_active' => 1,
        ]);

        $payload = $resource->toArray(request());

        $this->assertArrayHasKey('id', $payload);
        $this->assertArrayHasKey('name', $payload);
        $this->assertArrayHasKey('slug', $payload);
        $this->assertArrayHasKey('dashboard_route', $payload);
    }
}
