<?php

use App\Models\Tenant;
use App\Support\Links\RequiredPermissionsLinks;

it('builds a tenant-scoped required permissions link without filters', function (): void {
    $tenant = Tenant::factory()->make([
        'external_id' => 'tenant-123',
    ]);

    expect(RequiredPermissionsLinks::requiredPermissions($tenant))
        ->toBe('/admin/tenants/tenant-123/required-permissions');
});

it('builds a tenant-scoped required permissions link with filters', function (): void {
    $tenant = Tenant::factory()->make([
        'external_id' => 'tenant 123',
    ]);

    $url = RequiredPermissionsLinks::requiredPermissions($tenant, [
        'status' => 'all',
        'type' => 'application',
    ]);

    expect($url)->toBe('/admin/tenants/tenant+123/required-permissions?status=all&type=application');
});
