TenantAtlas/tests/Feature/ManagedTenantOnboardingWizardCredentialsConfirmationTest.php
2026-02-01 12:20:09 +01:00

36 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
use App\Filament\Pages\TenantOnboardingWizard;
use Livewire\Livewire;
it('requires acknowledgement before saving credentials', function (): void {
config()->set('tenantpilot.onboarding.credentials_required', true);
[$user, $portfolioTenant] = createUserWithTenant(role: 'owner');
$this->actingAs($user);
$tenantGuid = fake()->uuid();
Livewire::withQueryParams([
'tenant' => (string) $portfolioTenant->external_id,
])->test(TenantOnboardingWizard::class)
->goToNextWizardStep()
->fillForm([
'name' => 'Acme Corp',
'environment' => 'prod',
'tenant_id' => $tenantGuid,
'domain' => 'acme.example',
], 'form')
->goToNextWizardStep()
->fillForm([
'app_client_id' => fake()->uuid(),
'app_client_secret' => 'super-secret-value',
'acknowledge_credentials' => false,
], 'form')
->goToNextWizardStep()
->assertHasFormErrors(['acknowledge_credentials']);
});