<?php

declare(strict_types=1);

use Illuminate\Support\Facades\Route;

it('applies admin-db middleware to the admin api route group', function () {
    $route = collect(Route::getRoutes()->getRoutes())
        ->first(fn ($r) => $r->uri() === 'api/admin/tenants');

    expect($route)->not->toBeNull();
    expect($route->gatherMiddleware())->toContain('admin-db');
    // saas-admin по-прежнему в пайплайне (гейт не потерян)
    expect($route->gatherMiddleware())->toContain('saas-admin');
});
