<?php

it('keeps subusers route list permission linked to SUBUSERS_LIST node', function (): void {
    $routeFile = app_path('routes/subusersRoute.php');
    expect(is_file($routeFile))->toBeTrue();

    $code = (string)file_get_contents($routeFile);
    $normalized = preg_replace('/\s+/', ' ', $code);
    $needle = "definePermission('list_own_subusers', subusers_permission_node_key::SUBUSERS_LIST)";

    expect($normalized)->toContain($needle);
});

