create([ 'capabilities' => [ PlatformCapabilities::ACCESS_SYSTEM_PANEL, PlatformCapabilities::OPS_VIEW, PlatformCapabilities::RUNBOOKS_VIEW, PlatformCapabilities::RUNBOOKS_RUN, ], 'is_active' => true, ]); $this->actingAs($user, 'platform'); $this->get(Runbooks::getUrl(panel: 'system')) ->assertSuccessful() ->assertSee('No supported runbooks') ->assertDontSee('Rebuild Findings Lifecycle') ->assertDontSee('Backfills legacy findings lifecycle fields') ->assertDontSee('Preflight') ->assertDontSee('preflight') ->assertDontSee('Run: Rebuild Findings Lifecycle') ->assertDontSee('BACKFILL'); Livewire::test(Runbooks::class) ->assertActionDoesNotExist('preflight') ->assertActionDoesNotExist('run'); }); it('preserves runbooks view authorization semantics after removing the backfill runbook', function (): void { $user = PlatformUser::factory()->create([ 'capabilities' => [ PlatformCapabilities::ACCESS_SYSTEM_PANEL, PlatformCapabilities::OPS_VIEW, ], 'is_active' => true, ]); $this->actingAs($user, 'platform') ->get(Runbooks::getUrl(panel: 'system')) ->assertForbidden(); });