36 lines
1.1 KiB
PHP
36 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Filament\Pages\TenantOnboardingWizard;
|
|
use App\Models\TenantOnboardingSession;
|
|
use Livewire\Livewire;
|
|
|
|
it('renders disabled provider operation buttons for members without capability', function (): void {
|
|
config()->set('tenantpilot.onboarding.credentials_required', false);
|
|
|
|
[$user, $tenant] = createUserWithTenant(role: 'readonly');
|
|
|
|
TenantOnboardingSession::factory()->create([
|
|
'tenant_id' => $tenant->getKey(),
|
|
'created_by_user_id' => $user->getKey(),
|
|
'status' => 'active',
|
|
'current_step' => 'permissions',
|
|
'payload' => [
|
|
'tenant_id' => $tenant->tenant_id,
|
|
'environment' => $tenant->environment,
|
|
'name' => $tenant->name,
|
|
],
|
|
]);
|
|
|
|
$this->actingAs($user);
|
|
|
|
Livewire::withQueryParams([
|
|
'tenant' => (string) $tenant->external_id,
|
|
])
|
|
->test(TenantOnboardingWizard::class)
|
|
->assertSee('Verify permissions')
|
|
->assertSee('You do not have permission to run provider operations.')
|
|
->assertSeeHtml('disabled');
|
|
});
|