Recognise designated superusers in authenticated demography installation
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-13 13:41:48 +02:00
parent 291a1c420f
commit df543a4414
3 changed files with 16 additions and 3 deletions
@@ -44,6 +44,17 @@ final class DemographicInstallationTest extends TestCase
$this->actingAs(User::factory()->create())->getJson('/management/demography/install')->assertForbidden();
}
public function test_designated_superuser_does_not_require_the_legacy_manager_gate(): void
{
config(['portal.managers' => []]);
$this->assertFalse($this->manager->can('manage-portal'));
$this->actingAs($this->manager)->withSession(['portal.mfa_actor' => $this->manager->id, 'portal.mfa_at' => time()]);
$this->get('/management/demography/install')->assertOk()->assertInertia(fn (\Inertia\Testing\AssertableInertia $page) => $page
->component('management/demography-install')->where('plan.mfa_confirmed', true));
app(\App\Services\DemographicImport::class)->authorize($this->manager);
$this->assertTrue(true);
}
public function test_an_unavailable_interpreter_blocks_the_plan_before_installation(): void
{
config(['demography.python' => base_path('storage/nonexistent-demography-python.exe')]);