Some checks failed
Main Confidence / confidence (push) Failing after 1m1s
## Summary - integrate the current `platform-dev` branch into `dev` - bring the latest platform work from the integration branch into the main development branch - include the recent findings lifecycle backfill removal slice together with the already accumulated `platform-dev` changes ## Scope - source branch: `platform-dev` - target branch: `dev` - branch role: integration PR, not a single-feature PR ## Validation - branch state reviewed before PR creation - `platform-dev` is ahead of `dev` with the expected integration history - this PR intentionally carries the accumulated `platform-dev` commits into `dev` ## Notes - this is the correct merge direction for the current workflow, where feature branches land in `platform-dev` first and `platform-dev` is then merged into `dev` - after merging, `platform-dev` can be recreated fresh from `dev` as usual Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #295
60 lines
1.8 KiB
PHP
60 lines
1.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Filament\System\Pages\Ops\Runbooks;
|
|
use App\Models\PlatformUser;
|
|
use App\Support\Auth\PlatformCapabilities;
|
|
use Filament\Facades\Filament;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Livewire\Livewire;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
beforeEach(function (): void {
|
|
Filament::setCurrentPanel('system');
|
|
Filament::bootCurrentPanel();
|
|
});
|
|
|
|
it('keeps the system runbooks page accessible without findings lifecycle backfill launch surfaces', function (): void {
|
|
$user = PlatformUser::factory()->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();
|
|
});
|