Recognise designated superusers in authenticated demography installation
tests / ci (push) Canceled after 0s
tests / ci (push) Canceled after 0s
This commit is contained in:
@@ -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')]);
|
||||
|
||||
Reference in New Issue
Block a user