## Summary - restore broad full-suite green-signal coverage across platform governance, operations, onboarding, dashboard/productization, and customer review flows - align related platform tests and supporting behavior with the current expected state for this restoration pass - update the spec-candidates queue as part of the same suite-restoration sweep ## Validation - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Browser/Dashboard/TenantDashboardProductizationSmokeTest.php tests/Browser/Reviews/CustomerReviewWorkspaceSmokeTest.php tests/Browser/Spec194GovernanceFrictionSmokeTest.php tests/Browser/Spec265DecisionRegisterSmokeTest.php` Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #351
34 lines
853 B
PHP
34 lines
853 B
PHP
<?php
|
|
|
|
use App\Filament\Pages\Tenancy\RegisterTenant;
|
|
use App\Filament\Resources\TenantResource;
|
|
use Filament\Facades\Filament;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
use Livewire\Livewire;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
test('readonly users cannot access tenant registration', function () {
|
|
[$user] = createUserWithTenant(role: 'readonly');
|
|
|
|
$this->actingAs($user);
|
|
|
|
Filament::setCurrentPanel(Filament::getPanel('admin'));
|
|
|
|
expect(RegisterTenant::canView())->toBeFalse();
|
|
|
|
Livewire::actingAs($user)
|
|
->test(RegisterTenant::class)
|
|
->assertStatus(404);
|
|
|
|
Filament::setCurrentPanel(null);
|
|
});
|
|
|
|
test('readonly users cannot create tenants via CRUD', function () {
|
|
[$user] = createUserWithTenant(role: 'readonly');
|
|
|
|
$this->actingAs($user);
|
|
|
|
expect(TenantResource::canCreate())->toBeFalse();
|
|
});
|